Skip to content

Commit 99b87f9

Browse files
authored
feat:added scatterplot 3d chart (#8)
* docs(readme):fixed LICENSE badge * docs(readme):added link to other sections and emojis * feat:added scatterplot3d viz * feat:added scatterplot3d chart to dashboard * docs(readme):added section for scatterplot3d incl. screenshot * chore:replaced scatterplot example screenshot * chore:hide legend by default * style:resize plot when shrinking / expanding the panel * style:edited legend orientation and position * ci:renamed packaged app uploaded as artifact * chore:hide legend by default * build:updated plotly and underscore deps * fix:edited index calculation for data parsing * build(d3):updated dependency --------- Co-authored-by: Erica Pescio <[email protected]>
1 parent f7a8d8c commit 99b87f9

File tree

25 files changed

+4402
-41
lines changed

25 files changed

+4402
-41
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
bundle-app:
1313
name: Bundle App
1414
runs-on: ubuntu-latest
15+
outputs:
16+
artifact_name: ${{ steps.app.outputs.artifact_name }}
1517
steps:
1618
- uses: actions/checkout@v4
1719
- name: Read App Info
@@ -21,6 +23,7 @@ jobs:
2123
app_version=$(cat splunk_*/app.manifest | jq -r '.info.id.version')
2224
echo "name=${app_id}" >> $GITHUB_OUTPUT
2325
echo "version=${app_version}" >> $GITHUB_OUTPUT
26+
echo "artifact_name=${app_id}-${app_version}" >> $GITHUB_OUTPUT
2427
working-directory: ./packages
2528

2629
- name: Bundle app source
@@ -36,7 +39,7 @@ jobs:
3639
- name: Upload artifact
3740
uses: actions/upload-artifact@v4
3841
with:
39-
name: packaged_app
42+
name: ${{ steps.app.outputs.artifact_name }}
4043
path: ${{ steps.app.outputs.name }}*.tar.gz
4144

4245
slim-validate:
@@ -50,7 +53,7 @@ jobs:
5053
- name: Download artifact
5154
uses: actions/download-artifact@v4
5255
with:
53-
name: packaged_app
56+
name: ${{ needs.bundle-app.outputs.artifact_name }}
5457

5558
- name: Set up Python
5659
uses: actions/setup-python@v5
@@ -79,7 +82,7 @@ jobs:
7982
steps:
8083
- uses: actions/download-artifact@v4
8184
with:
82-
name: packaged_app
85+
name: ${{ needs.bundle-app.outputs.artifact_name }}
8386
path: dist
8487
- uses: splunk/[email protected]
8588
with:

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
outputs:
1919
ta_version: ${{ steps.app.outputs.version }}
20+
artifact_name: ${{ steps.app.outputs.artifact_name }}
2021
steps:
2122
- uses: actions/checkout@v4
2223
- name: Get App Info
@@ -28,6 +29,7 @@ jobs:
2829
app_version=$(cat "$MANIFEST" | jq -r '.info.id.version')
2930
echo "name=${app_id}" >> $GITHUB_OUTPUT
3031
echo "version=${app_version}" >> $GITHUB_OUTPUT
32+
echo "artifact_name=${app_id}-${app_version}" >> $GITHUB_OUTPUT
3133
else
3234
echo "Files Not Found ❌ Please add 'packages/$MANIFEST'"
3335
exit 1
@@ -46,7 +48,7 @@ jobs:
4648
4749
- uses: actions/upload-artifact@v4
4850
with:
49-
name: packaged_app
51+
name: ${{ steps.app.outputs.artifact_name }}
5052
path: ${{ steps.app.outputs.name }}*.tar.gz
5153

5254
release:
@@ -57,7 +59,7 @@ jobs:
5759
- uses: actions/checkout@v4
5860
- uses: actions/download-artifact@v4
5961
with:
60-
name: packaged_app
62+
name: ${{ needs.build.outputs.artifact_name }}
6163
path: dist
6264
- name: Fetch latest release info from CHANGELOG
6365
id: changelog

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fsplunkbasebadge.livehybrid.com%2Fv1%2Fdownloads%2F5730%2F)
44
[![Actions Status: test](https://github.com/splunk/splunk-plotly-collection-viz/actions/workflows/ci.yml/badge.svg)](https://github.com/splunk/splunk-plotly-collection-viz/actions?query=workflow%3A"CI")
55
[![Latest release (latest by date)](https://img.shields.io/github/v/release/splunk/splunk-plotly-collection-viz?label=Latest%20Release)](https://github.com/splunk/splunk-plotly-collection-viz/releases)
6-
[![License](https://img.shields.io/github/license/splunk/splunk-plotly-collection-viz)](LICENSE)
6+
[![License](https://img.shields.io/github/license/splunk/splunk-plotly-collection-viz)](./packages/splunk_plotly_collection_viz/LICENSE.md)
77

88
A collection of Splunk modular visualizations based on [plotly.js](https://github.com/plotly/plotly.js/), a JavaScript open-source library used to create interactive charts for finance, engineering and sciences.
99

1010
Visualizations included into this collection:
11-
* OHLC Chart - for Stocks and Financial Data ([source code](appserver/static/visualizations/ohlc/src/visualization_source.js))
12-
* Box Plot Chart - for Statistical Data ([source code](appserver/static/visualizations/boxplot/src/visualization_source.js))
13-
* Multiple Axes Chart - for Advanced Statistical Data Visualizations ([source code](appserver/static/visualizations/multiple-axes/src/visualization_source.js))
11+
* [OHLC Chart](#ohlc-chart) for Stocks and Financial Data :hammer_and_wrench: [source code](appserver/static/visualizations/ohlc/src/visualization_source.js)
12+
* [Box Plot Chart](#box-plot) for Statistical Data :hammer_and_wrench: [source code](appserver/static/visualizations/boxplot/src/visualization_source.js)
13+
* [Multiple Axes Chart](#multiple-axes-plot) for Advanced Statistical Data Visualizations :hammer_and_wrench: [source code](appserver/static/visualizations/multiple-axes/src/visualization_source.js)
14+
* [Scatterplot 3D](#scatterplot3d) for Multiple Dimensions / Clustering Data Visualizations :hammer_and_wrench: [source code](appserver/static/visualizations/scatterplot3d/src/visualization_source.js)
1415

1516
## Installation
1617
Please refer to the [Splunk Documentation](https://docs.splunk.com/Documentation/AddOns/released/Overview/Installingadd-ons) for guidance on installing the Add-On in your environment. The app needs to be installed on the SH tier.
@@ -62,6 +63,24 @@ Replace `_time`, `scatter-y2-datasetX` and `line-y-datasetX` with your fields to
6263
6364
![alt text](etc/MultipleAxes_plot.png "Multiple Axes Plot")
6465

66+
### Scatterplot 3D
67+
`<basesearch> | table trace x y z [marker_size]`
68+
69+
If not provided, default values will be used for optional field `marker_size`.
70+
71+
Replace `trace`, `x`, `y` and `z` with your fields to start.
72+
73+
| FieldName | Format | Description | Example |
74+
|-------------|---------|--------------------------|-----------|
75+
| `trace` | string | Label of the trace | `A` |
76+
| `x` | numeric | X-coordinate of data forming trace dataset | `20` |
77+
| `y` | numeric | Y-coordinate of data forming trace dataset | `2` |
78+
| `z` | numeric | Z-coordinate of data forming trace dataset | `100` |
79+
| `marker_size` | numeric | Size of the data marker in pixels. Range [1-50]. | `20` |
80+
81+
82+
![alt text](etc/scatterplot3d.png "Scatterplot 3D Chart Example")
83+
6584
## Example
6685
This app comes with a dashboard showcasing simple usages of mentioned charts.
6786

etc/scatterplot3d.png

143 KB
Loading

packages/splunk_plotly_collection_viz/README/savedsearches.conf.spec

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,13 @@ display.visualizations.custom.multiple-axes.multiple-axes.y2Angle = <float>
3838

3939
display.visualizations.custom.multiple-axes.multiple-axes.xAxisName = <string>
4040
display.visualizations.custom.multiple-axes.multiple-axes.yAxisName = <string>
41-
display.visualizations.custom.multiple-axes.multiple-axes.y2AxisName = <string>
41+
display.visualizations.custom.multiple-axes.multiple-axes.y2AxisName = <string>
42+
43+
display.visualizations.custom.scatterplot3d.scatterplot3d.mbDisplay = <number>
44+
display.visualizations.custom.scatterplot3d.scatterplot3d.showLegend = <number>
45+
display.visualizations.custom.scatterplot3d.scatterplot3d.xAngle = <float>
46+
display.visualizations.custom.scatterplot3d.scatterplot3d.yAngle = <float>
47+
display.visualizations.custom.scatterplot3d.scatterplot3d.zAngle = <float>
48+
display.visualizations.custom.scatterplot3d.scatterplot3d.xAxisName = <string>
49+
display.visualizations.custom.scatterplot3d.scatterplot3d.yAxisName = <string>
50+
display.visualizations.custom.scatterplot3d.scatterplot3d.zAxisName = <string>

packages/splunk_plotly_collection_viz/appserver/static/visualizations/boxplot/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/splunk_plotly_collection_viz/appserver/static/visualizations/boxplot/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"d3": "^7.6.1",
1919
"jquery": ">=3.5.0",
20-
"plotly.js-dist": "^2.4.1",
21-
"underscore": "^1.12.1"
20+
"plotly.js-dist": "^3.1.0",
21+
"underscore": "^1.13.7"
2222
}
2323
}

packages/splunk_plotly_collection_viz/appserver/static/visualizations/multiple-axes/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/splunk_plotly_collection_viz/appserver/static/visualizations/multiple-axes/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"d3": "^3.5.16",
1919
"lodash.clonedeep": "^4.5.0",
2020
"jquery": ">=3.5.0",
21-
"plotly.js-dist": "^2.4.1",
22-
"underscore": "^1.12.1"
21+
"plotly.js-dist": "^3.1.0",
22+
"underscore": "^1.13.7"
2323
}
2424
}

packages/splunk_plotly_collection_viz/appserver/static/visualizations/ohlc/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)