Skip to content

Commit 29c9f2f

Browse files
author
arcTerho
authored
Merge pull request #16 from Arction/nk/bump-v.3.1
Bump to LCJS v.3.1
2 parents 89d765a + 6602bad commit 29c9f2f

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"webpack-dev-server": "^3.11.0"
2525
},
2626
"dependencies": {
27-
"@arction/lcjs": "^3.0.0",
27+
"@arction/lcjs": "^3.1.0",
2828
"@arction/xydata": "^1.4.0"
2929
}
3030
}

src/app.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { createProgressiveTraceGenerator } from "@arction/xydata"
33

44
// Use theme if provided
55
const urlParams = new URLSearchParams(window.location.search);
6-
let theme = Themes.dark
6+
let theme = Themes.darkGold
77
if (urlParams.get('theme') == 'light')
8-
theme = Themes.light
8+
theme = Themes.lightNew
99

1010
let dataAmount = 1 * 1000 * 1000
1111

@@ -69,7 +69,7 @@ const measureRenderingSpeed = () => {
6969
const tNow = window.performance.now()
7070
const delay = tNow - tStart
7171
// Display result using UI indicator.
72-
indicatorRenderingSpeed.setText(`Rendering speed (${(dataAmount / (1 * 1000 * 1000)).toFixed(1)}M data-points): ${delay.toFixed(0)} ms`)
72+
indicatorRenderingSpeed.setText(`${(delay / 1000).toFixed(3)} seconds`)
7373
})
7474
})
7575
}
@@ -86,20 +86,19 @@ const indicatorLayout = chart.addUIElement<UIElementColumn<UIRectangle>>(
8686
)
8787
.setOrigin(UIOrigins.LeftTop)
8888
.setDraggingMode(UIDraggingModes.notDraggable)
89-
// Set dark, tinted Background style.
90-
.setBackground((background) => background
91-
.setFillStyle(new SolidFill({ color: theme.seriesBackgroundFillStyle.get('color').setA(150) }))
92-
.setStrokeStyle(emptyLine)
93-
)
89+
9490
// Reposition indicators whenever Axis scale is changed (to keep position static).
9591
const repositionIndicator = () =>
9692
indicatorLayout.setPosition({ x: axisX.getInterval().start, y: axisY.getInterval().end })
9793
repositionIndicator()
9894
axisX.onScaleChange(repositionIndicator)
9995
axisY.onScaleChange(repositionIndicator)
96+
97+
indicatorLayout.addElement<UITextBox>(UIElementBuilders.TextBox)
98+
.setText(`Rendering speed ${(dataAmount / (1 * 1000 * 1000)).toFixed(1)} million data points:`)
99+
100100
// Rendering speed indicator.
101-
const indicatorRenderingSpeed = indicatorLayout.addElement<UITextBox<UIRectangle>>(UIElementBuilders.TextBox)
102-
.setText('Rendering ...')
101+
const indicatorRenderingSpeed = indicatorLayout.addElement<UITextBox>(UIElementBuilders.TextBox)
103102
.setTextFont((font) => font
104103
.setWeight('bold')
105104
)

0 commit comments

Comments
 (0)