-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Niilo Keinänen
committed
Nov 5, 2024
0 parents
commit 6e1b9d3
Showing
12 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 16.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "16.x" | ||
|
||
- name: Build | ||
env: | ||
LCJS_LICENSE: ${{ secrets.LCJS_DEPLOY_LICENSE }} | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist | ||
publish_branch: gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 LightningChart Ltd. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Parallel Coordinate Chart with Value Thresholds | ||
|
||
![Parallel Coordinate Chart with Value Thresholds](parallelCoordChartThresholds-darkGold.png) | ||
|
||
This demo application belongs to the set of examples for LightningChart JS, data visualization library for JavaScript. | ||
|
||
LightningChart JS is entirely GPU accelerated and performance optimized charting library for presenting massive amounts of data. It offers an easy way of creating sophisticated and interactive charts and adding them to your website or web application. | ||
|
||
The demo can be used as an example or a seed project. Local execution requires the following steps: | ||
|
||
- Make sure that relevant version of [Node.js](https://nodejs.org/en/download/) is installed | ||
- Open the project folder in a terminal: | ||
|
||
npm install # fetches dependencies | ||
npm start # builds an application and starts the development server | ||
|
||
- The application is available at _http://localhost:8080_ in your browser, webpack-dev-server provides hot reload functionality. | ||
|
||
|
||
## Description | ||
|
||
A common use case is to display value thresholds on different axes. | ||
E.g. which value range is _bad_ and which is _good_. | ||
|
||
This example shows how this can be done by styling the Axis line style with a `PalettedFill`. | ||
|
||
## API Links | ||
|
||
|
||
|
||
## Support | ||
|
||
If you notice an error in the example code, please open an issue on [GitHub][0] repository of the entire example. | ||
|
||
Official [API documentation][1] can be found on [LightningChart][2] website. | ||
|
||
If the docs and other materials do not solve your problem as well as implementation help is needed, ask on [StackOverflow][3] (tagged lightningchart). | ||
|
||
If you think you found a bug in the LightningChart JavaScript library, please contact [email protected]. | ||
|
||
Direct developer email support can be purchased through a [Support Plan][4] or by contacting [email protected]. | ||
|
||
[0]: https://github.com/Arction/ | ||
[1]: https://lightningchart.com/lightningchart-js-api-documentation/ | ||
[2]: https://lightningchart.com | ||
[3]: https://stackoverflow.com/questions/tagged/lightningchart | ||
[4]: https://lightningchart.com/support-services/ | ||
|
||
© LightningChart Ltd 2009-2022. All rights reserved. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "2.0.0", | ||
"scripts": { | ||
"build": "webpack --mode production", | ||
"start": "webpack serve" | ||
}, | ||
"license": "MIT", | ||
"private": true, | ||
"main": "./src/index.js", | ||
"devDependencies": { | ||
"clean-webpack-plugin": "^4.0.0", | ||
"copy-webpack-plugin": "^10.0.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"webpack": "^5.64.4", | ||
"webpack-cli": "^4.9.1", | ||
"webpack-dev-server": "^4.6.0", | ||
"webpack-stream": "^7.0.0" | ||
}, | ||
"dependencies": { | ||
"@lightningchart/lcjs": "^6.0.0", | ||
"@lightningchart/xydata": "^1.4.0" | ||
}, | ||
"lightningChart": { | ||
"eID": "1704" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
const lcjs = require('@lightningchart/lcjs') | ||
const { lightningChart, Themes, SolidLine, PalettedFill, LUT, ColorRGBA } = lcjs | ||
|
||
const lc = lightningChart({ | ||
resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/', | ||
}) | ||
const chart = lc | ||
.ParallelCoordinateChart({ | ||
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined, | ||
}) | ||
.setTitle('Parallel Coordinate Chart with Value thresholds') | ||
|
||
const Axes = { | ||
'Variable A': 0, | ||
'Variable B': 1, | ||
'Variable C': 2, | ||
} | ||
chart.setAxes(Axes) | ||
chart.getAxis(Axes['Variable A']).setInterval({ start: 20, end: 60 }) | ||
chart.getAxis(Axes['Variable B']).setInterval({ start: 80, end: 120 }) | ||
chart.getAxis(Axes['Variable C']).setInterval({ start: 0.0, end: 2.5 }) | ||
|
||
const series1 = chart.addSeries().setName('Sample 1').setData({ | ||
'Variable A': 36, | ||
'Variable B': 100, | ||
'Variable C': 1.1, | ||
}) | ||
|
||
const series2 = chart.addSeries().setName('Sample 2').setData({ | ||
'Variable A': 32, | ||
'Variable B': 115, | ||
'Variable C': 0.5, | ||
}) | ||
|
||
const series3 = chart.addSeries().setName('Sample 3').setData({ | ||
'Variable A': 35, | ||
'Variable B': 82, | ||
'Variable C': 0.9, | ||
}) | ||
|
||
// Show value range warning thresholds for each axis. | ||
// This can be done by styling the Axis stroke with color lookup by Y | ||
const theme = chart.getTheme() | ||
const colorOK = ColorRGBA(0, 0, 0, 0) | ||
const colorWarning = theme.examples.badGoodColorPalette[0] | ||
chart.getAxis(Axes['Variable A']).setStrokeStyle( | ||
new SolidLine({ | ||
thickness: 4, | ||
fillStyle: new PalettedFill({ | ||
lookUpProperty: 'y', | ||
lut: new LUT({ | ||
interpolate: false, | ||
steps: [ | ||
{ value: 0, color: colorOK }, | ||
{ value: 50, color: colorWarning }, | ||
], | ||
}), | ||
}), | ||
}), | ||
) | ||
chart.getAxis(Axes['Variable B']).setStrokeStyle( | ||
new SolidLine({ | ||
thickness: 4, | ||
fillStyle: new PalettedFill({ | ||
lookUpProperty: 'y', | ||
lut: new LUT({ | ||
interpolate: false, | ||
steps: [ | ||
{ value: 0, color: colorWarning }, | ||
{ value: 85, color: colorOK }, | ||
], | ||
}), | ||
}), | ||
}), | ||
) | ||
chart.getAxis(Axes['Variable C']).setStrokeStyle( | ||
new SolidLine({ | ||
thickness: 4, | ||
fillStyle: new PalettedFill({ | ||
lookUpProperty: 'y', | ||
lut: new LUT({ | ||
interpolate: false, | ||
steps: [ | ||
{ value: 0, color: colorWarning }, | ||
{ value: 0.2, color: colorOK }, | ||
{ value: 1.5, color: colorWarning }, | ||
], | ||
}), | ||
}), | ||
}), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
const HtmlWebpackPlugin = require('html-webpack-plugin') | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin') | ||
const CopyWebpackPlugin = require('copy-webpack-plugin') | ||
const path = require('path') | ||
const webpack = require('webpack') | ||
|
||
const targetFolderName = 'dist' | ||
const outputPath = path.resolve(__dirname, targetFolderName) | ||
const packageJSON = require('./package.json') | ||
|
||
module.exports = { | ||
mode: 'development', | ||
entry: { | ||
app: packageJSON.main, | ||
}, | ||
devServer: { | ||
static: outputPath, | ||
compress: true, | ||
}, | ||
resolve: { | ||
modules: [path.resolve('./src'), path.resolve('./node_modules')], | ||
extensions: ['.js'], | ||
}, | ||
output: { | ||
filename: 'js/[name].[contenthash].bundle.js', | ||
chunkFilename: 'js/[name].[contenthash].bundle.js', | ||
path: outputPath, | ||
}, | ||
optimization: { | ||
splitChunks: { | ||
chunks: 'all', | ||
cacheGroups: { | ||
// make separate 'vendor' chunk that contains any dependencies | ||
// allows for smaller file sizes and faster builds | ||
vendor: { | ||
test: /[\\/]node_modules[\\/]/, | ||
chunks: 'initial', | ||
name: 'vendor', | ||
priority: -10, | ||
reuseExistingChunk: true, | ||
}, | ||
}, | ||
}, | ||
runtimeChunk: 'single', | ||
}, | ||
plugins: [ | ||
new CleanWebpackPlugin(), | ||
new HtmlWebpackPlugin({ | ||
title: 'app', | ||
filename: path.resolve(__dirname, 'dist', 'index.html'), | ||
}), | ||
new CopyWebpackPlugin({ | ||
patterns: [ | ||
{ | ||
from: './assets/**/*', | ||
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`, | ||
noErrorOnMissing: true, | ||
}, | ||
{ | ||
from: './node_modules/@lightningchart/lcjs/dist/resources', | ||
to: 'resources', | ||
noErrorOnMissing: true, | ||
}, | ||
], | ||
}), | ||
new webpack.DefinePlugin({ | ||
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'", | ||
}), | ||
], | ||
} |