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 9890391 commit b70f5a0
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 106 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
© LightningChart Ltd 2009-2022. All rights reserved.


[LightningChart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/functions/lightningChart-1.html
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
[Axis XY]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/Axis.html
[Area Series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/AreaSeriesPositive.html
[Heatmap Grid Series]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/HeatmapGridSeriesIntensityValues.html
[UI LUT range]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/interfaces/UILUTRange.html
[UI Element]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/interfaces/UIElement.html
[Axis Tick strategies]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/AxisTickStrategies.html
[Area series types]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/AreaSeriesTypes.html
[Color factory RGBA]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/functions/ColorRGBA.html
[Paletted fill style]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/PalettedFill.html
[Color lookup table]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/LUT.html
[Empty line style]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/emptyLine.html
[Empty fill style]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/emptyFill-1.html
[Empty tick style]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/emptyTick.html
[UI element builders]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/UIElementBuilders.html
[UI origins]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/variables/UIOrigins.html
[LightningChart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/functions/lightningChart-1.html
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
[Axis XY]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/Axis.html
[Area Series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/AreaSeriesPositive.html
[Heatmap Grid Series]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/HeatmapGridSeriesIntensityValues.html
[UI LUT range]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/interfaces/UILUTRange.html
[UI Element]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/interfaces/UIElement.html
[Axis Tick strategies]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/AxisTickStrategies.html
[Area series types]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/AreaSeriesTypes.html
[Color factory RGBA]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/functions/ColorRGBA.html
[Paletted fill style]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/PalettedFill.html
[Color lookup table]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/LUT.html
[Empty line style]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/emptyLine.html
[Empty fill style]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/emptyFill-1.html
[Empty tick style]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/emptyTick.html
[UI element builders]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/variables/UIElementBuilders.html
[UI 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": "0507"
Expand Down
46 changes: 24 additions & 22 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* LightningChartJS example that showcases a real life application used in Fiber Monitoring
*/
// 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 @@ -130,29 +130,37 @@ const lut = new LUT({
dataPromise.then((data) => {
const { traceDataArray, areaData } = data

const areaSeries = chart
.addAreaSeries({ type: AreaSeriesTypes.Positive, yAxis: axisTopY })
.add(areaData)
.setCursorResultTableFormatter((builder, series, x, y) =>
builder.addRow('Intensity sum:', '', y.toFixed(1)).addRow('Optical fiber distance:', '', axisX.formatValue(x) + ' m'),
)
chart.setCursorFormatting((_, __, hits) => {
const hitIntensity = hits.find((hit) => hit.series === areaSeries)
const hitHeatmap = hits.find((hit) => hit.series === heatmapSeries)
if (!hitIntensity || !hitHeatmap) return
return [
[`Optical fiber distance`, '', `${Math.round(hitIntensity.x)} m`],
[hitIntensity.series, '', hitIntensity.axisY.formatValue(hitIntensity.y)],
[hitHeatmap.series, ''],
['', hitHeatmap.axisY.formatValue(hitHeatmap.y)],
['Intensity', '', hitHeatmap.intensity.toFixed(1)],
]
})

const areaSeries = chart.addAreaSeries({ type: AreaSeriesTypes.Positive, yAxis: axisTopY }).add(areaData)

const heatmapOptions = {
columns: traceDataArray[0].length,
rows: traceDataArray.length,
start: {
x: CONFIG.opticalFibreDistanceStart,
y: CONFIG.timeStart - dateOrigin,
},
step: {
x: CONFIG.opticalFibreDistanceStep,
y: CONFIG.timeStep,
},
dataOrder: 'rows',
yAxis: axisBottomY,
}
const heatmapSeries = chart
.addHeatmapGridSeries(heatmapOptions)
.setStart({
x: CONFIG.opticalFibreDistanceStart,
y: CONFIG.timeStart - dateOrigin,
})
.setStep({
x: CONFIG.opticalFibreDistanceStep,
y: CONFIG.timeStep,
})
.setIntensityInterpolation('disabled')
.invalidateIntensityValues(traceDataArray)
.setFillStyle(
Expand All @@ -162,12 +170,6 @@ dataPromise.then((data) => {
}),
)
.setWireframeStyle(emptyLine)
.setCursorResultTableFormatter((builder, series, dataPoint) =>
builder
.addRow('Intensity:', '', dataPoint.intensity.toFixed(1))
.addRow('Optical fiber distance:', '', axisX.formatValue(dataPoint.x) + ' m')
.addRow('Time:', '', axisBottomY.formatValue(dataPoint.y)),
)

chart.setPadding({
bottom: 64,
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 b70f5a0

Please sign in to comment.