@@ -3,9 +3,9 @@ import { createProgressiveTraceGenerator } from "@arction/xydata"
33
44// Use theme if provided
55const urlParams = new URLSearchParams ( window . location . search ) ;
6- let theme = Themes . dark
6+ let theme = Themes . darkGold
77if ( urlParams . get ( 'theme' ) == 'light' )
8- theme = Themes . light
8+ theme = Themes . lightNew
99
1010let 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).
9591const repositionIndicator = ( ) =>
9692 indicatorLayout . setPosition ( { x : axisX . getInterval ( ) . start , y : axisY . getInterval ( ) . end } )
9793repositionIndicator ( )
9894axisX . onScaleChange ( repositionIndicator )
9995axisY . 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