Skip to content

Commit 8b2adf3

Browse files
author
Niilo Keinänen
committed
v6.0.0
1 parent 763530f commit 8b2adf3

File tree

4 files changed

+88
-108
lines changed

4 files changed

+88
-108
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Direct developer email support can be purchased through a [Support Plan][4] or b
6969
© LightningChart Ltd 2009-2022. All rights reserved.
7070

7171

72-
[Data Grid]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/DataGrid.html
73-
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/classes/ChartXY.html
74-
[Spark Chart]: https://lightningchart.com/js-charts/api-documentation/v5.2.0/types/SparkChart.html
72+
[Data Grid]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/DataGrid.html
73+
[Chart XY]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/classes/ChartXY.html
74+
[Spark Chart]: https://lightningchart.com/js-charts/api-documentation/v6.0.0/types/SparkChart.html
7575

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"webpack-stream": "^7.0.0"
1818
},
1919
"dependencies": {
20-
"@arction/xydata": "^1.4.0",
21-
"@arction/lcjs": "^5.2.0"
20+
"@lightningchart/lcjs": "^6.0.0",
21+
"@lightningchart/xydata": "^1.4.0"
2222
},
2323
"lightningChart": {
2424
"eID": "1300"

src/index.js

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const lcjs = require('@arction/lcjs')
1+
const lcjs = require('@lightningchart/lcjs')
22
const { AxisTickStrategies, emptyTick, FormattingFunctions, SolidLine, emptyFill, SolidFill, lightningChart, Themes } = lcjs
33

44
const highlightIntensity = 0.2 // [0, 1]
@@ -70,6 +70,7 @@ const setDrillDown = (() => {
7070
theme: Themes[new URLSearchParams(window.location.search).get('theme') || 'darkGold'] || undefined,
7171
})
7272
.setTitle(name)
73+
.setCursor((cursor) => cursor.setTickMarkerXVisible(false))
7374
chart
7475
.getDefaultAxisX()
7576
.setTickStrategy(AxisTickStrategies.DateTime)
@@ -78,68 +79,47 @@ const setDrillDown = (() => {
7879
endMax: state.dataMax,
7980
}))
8081
chart.getDefaultAxisY().dispose()
81-
const axisRate = chart.addAxisY({ iStack: 3 }).setTitle(`Rate $`).setMargins(10, 0)
82+
const axisRate = chart.addAxisY({ iStack: 3 }).setTitle(`Rate`).setUnits('$').setMargins(10, 0)
8283
const seriesRate = chart
8384
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX', yAxis: axisRate })
8485
.setAreaFillStyle(emptyFill)
85-
.setName(`${name} Rate $`)
86-
.appendJSON(coinData.map((p) => ({ x: p.date, y: p.rate })))
87-
.setCursorResultTableFormatter((builder, series, dataPoint) =>
88-
builder
89-
.addRow(series.getName())
90-
.addRow(timeAxis.formatValue(dataPoint.x))
91-
.addRow(`$${series.axisY.formatValue(dataPoint.y)}`),
92-
)
86+
.setName(`${name} Rate`)
87+
.appendJSON(coinData, { x: 'date', y: 'rate' })
9388

9489
const axisVolume = chart
9590
.addAxisY({ iStack: 2 })
96-
.setTitle(`Volume $`)
91+
.setTitle(`Volume`)
92+
.setUnits('$')
9793
.setMargins(10, 10)
9894
.setTickStrategy(AxisTickStrategies.Numeric, (ticks) => ticks.setFormattingFunction(FormattingFunctions.NumericUnits))
9995
const seriesVolume = chart
100-
.addAreaSeries({ yAxis: axisVolume })
101-
.setName(`${name} Volume $`)
102-
.add(coinData.map((p) => ({ x: p.date, y: p.volume })))
103-
.setCursorResultTableFormatter((builder, series, x, high, low) =>
104-
builder
105-
.addRow(series.getName())
106-
.addRow(timeAxis.formatValue(x))
107-
.addRow(`$${(high / 10 ** 9).toFixed(3)} B`),
108-
)
96+
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX', yAxis: axisVolume })
97+
.setName(`${name} Volume`)
98+
.appendJSON(coinData, { x: 'date', y: 'volume' })
10999

110100
const axisLiquidity = chart
111101
.addAxisY({ iStack: 1 })
112-
.setTitle(`Liquidity $`)
102+
.setTitle(`Liquidity`)
103+
.setUnits('$')
113104
.setMargins(10, 10)
114105
.setTickStrategy(AxisTickStrategies.Numeric, (ticks) => ticks.setFormattingFunction(FormattingFunctions.NumericUnits))
115106
const seriesLiquidity = chart
116107
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX', yAxis: axisLiquidity })
117108
.setAreaFillStyle(emptyFill)
118-
.setName(`${name} Liquidity $`)
119-
.add(coinData.map((p) => ({ x: p.date, y: p.liquidity })))
120-
.setCursorResultTableFormatter((builder, series, dataPoint) =>
121-
builder
122-
.addRow(series.getName())
123-
.addRow(timeAxis.formatValue(dataPoint.x))
124-
.addRow(`$${series.axisY.formatValue(dataPoint.y)}`),
125-
)
109+
.setName(`${name} Liquidity`)
110+
.appendJSON(coinData, { x: 'date', y: 'liquidity' })
126111

127112
const axisCap = chart
128113
.addAxisY({ iStack: 0 })
129-
.setTitle(`Market Cap $`)
114+
.setTitle(`Market Cap`)
115+
.setUnits('$')
130116
.setMargins(0, 10)
131117
.setTickStrategy(AxisTickStrategies.Numeric, (ticks) => ticks.setFormattingFunction(FormattingFunctions.NumericUnits))
132118
const seriesCap = chart
133119
.addPointLineAreaSeries({ dataPattern: 'ProgressiveX', yAxis: axisCap })
134120
.setAreaFillStyle(emptyFill)
135-
.setName(`${name} Market Cap $`)
136-
.add(coinData.map((p) => ({ x: p.date, y: p.cap })))
137-
.setCursorResultTableFormatter((builder, series, dataPoint) =>
138-
builder
139-
.addRow(series.getName())
140-
.addRow(timeAxis.formatValue(dataPoint.x))
141-
.addRow(`$${series.axisY.formatValue(dataPoint.y)}`),
142-
)
121+
.setName(`${name} Market Cap`)
122+
.appendJSON(coinData, { x: 'date', y: 'cap' })
143123

144124
chart.forEachAxis((axis) => axis.setAnimationScroll(false))
145125
const timeAxis = chart.getDefaultAxisX()

webpack.config.js

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
const HtmlWebpackPlugin = require("html-webpack-plugin");
2-
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
3-
const CopyWebpackPlugin = require("copy-webpack-plugin");
4-
const path = require("path");
5-
const webpack = require('webpack');
1+
const HtmlWebpackPlugin = require('html-webpack-plugin')
2+
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
3+
const CopyWebpackPlugin = require('copy-webpack-plugin')
4+
const path = require('path')
5+
const webpack = require('webpack')
66

7-
const targetFolderName = "dist";
8-
const outputPath = path.resolve(__dirname, targetFolderName);
9-
const packageJSON = require("./package.json");
7+
const targetFolderName = 'dist'
8+
const outputPath = path.resolve(__dirname, targetFolderName)
9+
const packageJSON = require('./package.json')
1010

1111
module.exports = {
12-
mode: "development",
13-
entry: {
14-
app: packageJSON.main,
15-
},
16-
devServer: {
17-
static: outputPath,
18-
compress: true,
19-
},
20-
resolve: {
21-
modules: [path.resolve("./src"), path.resolve("./node_modules")],
22-
extensions: [".js"],
23-
},
24-
output: {
25-
filename: "js/[name].[contenthash].bundle.js",
26-
chunkFilename: "js/[name].[contenthash].bundle.js",
27-
path: outputPath,
28-
},
29-
optimization: {
30-
splitChunks: {
31-
chunks: "all",
32-
cacheGroups: {
33-
// make separate 'vendor' chunk that contains any dependencies
34-
// allows for smaller file sizes and faster builds
35-
vendor: {
36-
test: /[\\/]node_modules[\\/]/,
37-
chunks: "initial",
38-
name: "vendor",
39-
priority: -10,
40-
reuseExistingChunk: true,
41-
},
42-
},
12+
mode: 'development',
13+
entry: {
14+
app: packageJSON.main,
4315
},
44-
runtimeChunk: "single",
45-
},
46-
plugins: [
47-
new CleanWebpackPlugin(),
48-
new HtmlWebpackPlugin({
49-
title: "app",
50-
filename: path.resolve(__dirname, "dist", "index.html"),
51-
}),
52-
new CopyWebpackPlugin({
53-
patterns: [
54-
{
55-
from: "./assets/**/*",
56-
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
57-
noErrorOnMissing: true,
58-
},
59-
{
60-
from: "./node_modules/@arction/lcjs/dist/resources",
61-
to: "resources",
62-
noErrorOnMissing: true,
16+
devServer: {
17+
static: outputPath,
18+
compress: true,
19+
},
20+
resolve: {
21+
modules: [path.resolve('./src'), path.resolve('./node_modules')],
22+
extensions: ['.js'],
23+
},
24+
output: {
25+
filename: 'js/[name].[contenthash].bundle.js',
26+
chunkFilename: 'js/[name].[contenthash].bundle.js',
27+
path: outputPath,
28+
},
29+
optimization: {
30+
splitChunks: {
31+
chunks: 'all',
32+
cacheGroups: {
33+
// make separate 'vendor' chunk that contains any dependencies
34+
// allows for smaller file sizes and faster builds
35+
vendor: {
36+
test: /[\\/]node_modules[\\/]/,
37+
chunks: 'initial',
38+
name: 'vendor',
39+
priority: -10,
40+
reuseExistingChunk: true,
41+
},
42+
},
6343
},
64-
],
65-
}),
66-
new webpack.DefinePlugin({
67-
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
68-
}),
69-
],
70-
};
44+
runtimeChunk: 'single',
45+
},
46+
plugins: [
47+
new CleanWebpackPlugin(),
48+
new HtmlWebpackPlugin({
49+
title: 'app',
50+
filename: path.resolve(__dirname, 'dist', 'index.html'),
51+
}),
52+
new CopyWebpackPlugin({
53+
patterns: [
54+
{
55+
from: './assets/**/*',
56+
to: `./examples/assets/${packageJSON.lightningChart.eID}/[name][ext]`,
57+
noErrorOnMissing: true,
58+
},
59+
{
60+
from: './node_modules/@lightningchart/lcjs/dist/resources',
61+
to: 'resources',
62+
noErrorOnMissing: true,
63+
},
64+
],
65+
}),
66+
new webpack.DefinePlugin({
67+
LCJS_LICENSE: "'" + process.env.LCJS_LICENSE + "'",
68+
}),
69+
],
70+
}

0 commit comments

Comments
 (0)