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 5bfced3 commit 1526591
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 97 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
© LightningChart Ltd 2009-2022. All rights reserved.


[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
[Area point]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/interfaces/AreaPoint.html
[Area Range series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/AreaRangeSeries.html
[XY cartesian chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
[Area point]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/interfaces/AreaPoint.html
[Area Range series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/AreaRangeSeries.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": "0105"
Expand Down
38 changes: 11 additions & 27 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* LightningChartJS example that showcases a simulation of daily temperature variations.
*/
// Import LightningChartJS
const lcjs = require('@arction/lcjs')
const lcjs = require('@lightningchart/lcjs')

// Extract required parts from LightningChartJS.
const { lightningChart, AxisTickStrategies, SolidFill, SolidLine, ColorRGBA, ColorHEX, LegendBoxBuilders, LinearGradientFill, Themes } =
Expand All @@ -11,19 +11,20 @@ const { lightningChart, AxisTickStrategies, SolidFill, SolidLine, ColorRGBA, Col
// Create a XY Chart.
const chart = lightningChart({
resourcesBaseUrl: new URL(document.head.baseURI).origin + new URL(document.head.baseURI).pathname + 'resources/',
}).ChartXY({
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
}).setTitle('Daily temperature range, April 2019')
})
.ChartXY({
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
})
.setTitle('Daily temperature range, April 2019')

const axisX = chart.getDefaultAxisX()
const axisY = chart.getDefaultAxisY().setTitle('Temperature (°C)').setScrollStrategy(undefined)
const axisY = chart.getDefaultAxisY().setTitle('Temperature').setUnits('°C').setScrollStrategy(undefined)

// Use DateTime TickStrategy and set the interval
axisX.setTickStrategy(AxisTickStrategies.DateTime)
.setInterval({
start: new Date(2019, 0, 1).getTime(),
end: new Date(2019, 0, 31).getTime()
})
axisX.setTickStrategy(AxisTickStrategies.DateTime).setInterval({
start: new Date(2019, 0, 1).getTime(),
end: new Date(2019, 0, 31).getTime(),
})

// Daily temperature records
const recordRange = chart.addAreaRangeSeries()
Expand Down Expand Up @@ -61,23 +62,6 @@ currentRange
.setHighStrokeStyle(currentRangeStrokeFillStyle)
.setLowStrokeStyle(currentRangeStrokeFillStyle)

// ----- Result tables settings
// Record range
recordRange.setCursorResultTableFormatter((builder, series, figure, yMax, yMin) => {
return builder
.addRow('Temperature records range')
.addRow('Date: ' + axisX.formatValue(figure))
.addRow('Highest: ' + yMax.toFixed(2) + ' °C')
.addRow('Lowest: ' + yMin.toFixed(2) + ' °C')
})
// Current range
currentRange.setCursorResultTableFormatter((builder, series, figure, yMax, yMin) => {
return builder
.addRow('2019 temperatures')
.addRow('Date: ' + axisX.formatValue(figure))
.addRow('Highest: ' + yMax.toFixed(2) + ' °C')
.addRow('Lowest: ' + yMin.toFixed(2) + ' °C')
})
// ----- Generating data
const randomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min
Expand Down
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 1526591

Please sign in to comment.