Skip to content

Commit

Permalink
v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Niilo Keinänen committed Aug 5, 2024
1 parent 137b118 commit e870a03
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 113 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ This example shows usage of BoxSeries in extravagant manner.
* [Axis]
* [Scroll strategies]
* [Box series]
* [Box and whiskers Figure]
* [Horizontal Legend box]
* [UI dragging modes]
* [UI position origins]
Expand All @@ -60,17 +59,16 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
© LightningChart Ltd 2009-2022. All rights reserved.


[Color palettes]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/ColorPalettes.html
[Solid FillStyle]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/SolidFill.html
[Solid LineStyle]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/SolidLine.html
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
[cursor modes]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/enums/AutoCursorModes.html
[cursor]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/interfaces/AutoCursorXY.html
[Axis]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/Axis.html
[Scroll strategies]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/AxisScrollStrategies.html
[Box series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/BoxSeries.html
[Box and whiskers Figure]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/BoxAndWhiskers.html
[Horizontal Legend box]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/LegendBoxBuilders.html
[UI dragging modes]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/enums/UIDraggingModes.html
[UI position origins]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/UIOrigins.html
[Color palettes]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/ColorPalettes.html
[Solid FillStyle]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/SolidFill.html
[Solid LineStyle]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/SolidLine.html
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
[cursor modes]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/enums/AutoCursorModes.html
[cursor]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/interfaces/AutoCursorXY.html
[Axis]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/Axis.html
[Scroll strategies]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/AxisScrollStrategies.html
[Box series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/BoxSeries.html
[Horizontal Legend box]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/LegendBoxBuilders.html
[UI dragging modes]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/enums/UIDraggingModes.html
[UI position origins]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/UIOrigins.html

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"webpack-stream": "^7.0.0"
},
"dependencies": {
"@arction/xydata": "^1.4.0",
"@arction/lcjs": "^5.2.0"
"@lightningchart/lcjs": "^6.0.0",
"@lightningchart/xydata": "^1.4.0"
},
"lightningChart": {
"eID": "0601"
Expand Down
35 changes: 3 additions & 32 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* LightningChartJS example that showcases usage of BoxSeries and RangeSeries to show some made-up statistical graphs.
*/
// Import LightningChartJS
const lcjs = require('@arction/lcjs')
const lcjs = require('@lightningchart/lcjs')

// Import xydata
const xydata = require('@arction/xydata')
const xydata = require('@lightningchart/xydata')

// Extract required parts from LightningChartJS.
const {
Expand Down Expand Up @@ -68,11 +68,7 @@ const chart = lightningChart({
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
})
.setTitle('Probability distribution + Simulated accumulation and BoxSeries')
// Set auto-cursor mode to 'onHover'
.setAutoCursorMode(AutoCursorModes.onHover)
.setAutoCursor((cursor) =>
cursor.setResultTableAutoTextStyle(false).setTickMarkerXAutoTextStyle(false).setTickMarkerYAutoTextStyle(false),
)
.setCursorMode('show-pointed')
.setPadding({ right: 20 })

const xBounds = { min: -4, max: 4 }
Expand Down Expand Up @@ -214,28 +210,3 @@ const legend = chart
maxWidth: 0.8,
})
legend.add(chart)

cumulativeDistributionSeries.setCursorResultTableFormatter((tableBuilder, rangeSeries, position, high, low) => {
const x = position.toFixed(2) == '-0.00' ? '0.00' : position.toFixed(2)
return tableBuilder
.addRow('Simulated Cumulative Distribution')
.addRow('Position ' + x)
.addRow('High ' + high.toFixed(2))
.addRow('Base ' + low.toFixed(2))
})
probabilityDistributionSeries.setCursorResultTableFormatter((tableBuilder, rangeSeries, position, high, low) => {
const x = position.toFixed(2) == '-0.00' ? '0.00' : position.toFixed(2)
return tableBuilder
.addRow('Probability Distribution')
.addRow('Position ' + x)
.addRow('Value ' + high.toFixed(2))
.addRow('Base ' + low.toFixed(2))
})
violinSeries.setCursorResultTableFormatter((tableBuilder, rangeSeries, position, high, low) => {
const x = position.toFixed(2) == '-0.00' ? '0.00' : position.toFixed(2)
return tableBuilder
.addRow('Violin')
.addRow('Position ' + x)
.addRow('Value ' + high.toFixed(2))
.addRow('Low ' + low.toFixed(2))
})
130 changes: 65 additions & 65 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,70 +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 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");
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,
},
},
mode: 'development',
entry: {
app: packageJSON.main,
},
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/@arction/lcjs/dist/resources",
to: "resources",
noErrorOnMissing: true,
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,
},
},
},
],
}),
new webpack.DefinePlugin({
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
}),
],
};
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 + "'",
}),
],
}

0 comments on commit e870a03

Please sign in to comment.