File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ const deselectHandler = () => {
7777
7878const scatterplot = createScatterplot ( {
7979 canvas,
80- width,
81- height,
8280 pointSize,
8381 xScale,
8482 yScale,
@@ -106,8 +104,6 @@ const resizeHandler = () => {
106104 // Render grid
107105 xAxis . tickSizeInner ( - height ) ;
108106 yAxis . tickSizeInner ( - width ) ;
109-
110- scatterplot . set ( { width, height } ) ;
111107} ;
112108
113109window . addEventListener ( 'resize' , resizeHandler ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ const exampleEl = document.querySelector(
1818exampleEl . setAttribute ( 'class' , 'active' ) ;
1919exampleEl . removeAttribute ( 'href' ) ;
2020
21- let { width, height } = canvas . getBoundingClientRect ( ) ;
22-
2321let points = [ ] ;
2422let numPoints = 9000 ;
2523let pointSize = 1 ;
@@ -53,8 +51,6 @@ const deselectHandler = () => {
5351
5452const scatterplot = createScatterplot ( {
5553 canvas,
56- width,
57- height,
5854 lassoMinDelay,
5955 lassoMinDist,
6056 pointSize,
@@ -70,13 +66,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
7066scatterplot . subscribe ( 'select' , selectHandler ) ;
7167scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
7268
73- const resizeHandler = ( ) => {
74- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
75- scatterplot . set ( { width, height } ) ;
76- } ;
77-
78- window . addEventListener ( 'resize' , resizeHandler ) ;
79-
8069const generatePoints = ( num ) => {
8170 const numPointsPerGroup = Math . round ( num / 3 ) ; // 9.000 / 3 => 3000
8271 const numPointsPerStep = Math . round ( numPointsPerGroup / 5 ) ; // 3000 / 5 => 600
Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ const exampleEl = document.querySelector('#example-connected-points');
1616exampleEl . setAttribute ( 'class' , 'active' ) ;
1717exampleEl . removeAttribute ( 'href' ) ;
1818
19- let { width, height } = canvas . getBoundingClientRect ( ) ;
20-
2119let points = [ ] ;
2220let numPoints = 9000 ;
2321let pointSize = 1 ;
@@ -51,8 +49,6 @@ const deselectHandler = () => {
5149
5250const scatterplot = createScatterplot ( {
5351 canvas,
54- width,
55- height,
5652 lassoMinDelay,
5753 lassoMinDist,
5854 pointSize,
@@ -68,13 +64,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
6864scatterplot . subscribe ( 'select' , selectHandler ) ;
6965scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
7066
71- const resizeHandler = ( ) => {
72- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
73- scatterplot . set ( { width, height } ) ;
74- } ;
75-
76- window . addEventListener ( 'resize' , resizeHandler ) ;
77-
7867const generatePoints = ( num ) => {
7968 const numPointsPerGroup = Math . round ( num / 3 ) ; // 9.000 / 3 => 3000
8069 const numPointsPerStep = Math . round ( numPointsPerGroup / 5 ) ; // 3000 / 5 => 600
Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ const exampleEl = document.querySelector('#example-basic');
1616exampleEl . setAttribute ( 'class' , 'active' ) ;
1717exampleEl . removeAttribute ( 'href' ) ;
1818
19- let { width, height } = canvas . getBoundingClientRect ( ) ;
20-
2119let points = [ ] ;
2220let numPoints = 100000 ;
2321let pointSize = 2 ;
@@ -64,8 +62,6 @@ const deselectHandler = () => {
6462
6563const scatterplot = createScatterplot ( {
6664 canvas,
67- width,
68- height,
6965 lassoMinDelay,
7066 lassoMinDist,
7167 pointSize,
@@ -80,13 +76,6 @@ scatterplot.subscribe('pointout', pointoutHandler);
8076scatterplot . subscribe ( 'select' , selectHandler ) ;
8177scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
8278
83- const resizeHandler = ( ) => {
84- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
85- scatterplot . set ( { width, height } ) ;
86- } ;
87-
88- window . addEventListener ( 'resize' , resizeHandler ) ;
89-
9079const generatePoints = ( num ) =>
9180 new Array ( num ) . fill ( ) . map ( ( ) => [
9281 - 1 + Math . random ( ) * 2 , // x
Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ const exampleEl = document.querySelector('#example-performance-mode');
2020exampleEl . setAttribute ( 'class' , 'active' ) ;
2121exampleEl . removeAttribute ( 'href' ) ;
2222
23- let { width, height } = canvas . getBoundingClientRect ( ) ;
24-
2523let points = [ ] ;
2624let numPoints = 20000000 ;
2725let pointSize = 0.25 ;
@@ -70,8 +68,6 @@ const deselectHandler = () => {
7068
7169const scatterplot = createScatterplot ( {
7270 canvas,
73- width,
74- height,
7571 lassoMinDelay,
7672 lassoMinDist,
7773 pointSize,
@@ -84,13 +80,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
8480scatterplot . subscribe ( 'select' , selectHandler ) ;
8581scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
8682
87- const resizeHandler = ( ) => {
88- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
89- scatterplot . set ( { width, height } ) ;
90- } ;
91-
92- window . addEventListener ( 'resize' , resizeHandler ) ;
93-
9483const setNumPoint = ( newNumPoints ) => {
9584 showModal (
9685 `Hang tight. Generating ${ ( numPoints / 1000000 ) . toFixed (
Original file line number Diff line number Diff line change @@ -19,8 +19,6 @@ const exampleEl = document.querySelector('#example-size-encoding');
1919exampleEl . setAttribute ( 'class' , 'active' ) ;
2020exampleEl . removeAttribute ( 'href' ) ;
2121
22- let { width, height } = canvas . getBoundingClientRect ( ) ;
23-
2422let points = [ ] ;
2523let numPoints = 100000 ;
2624let pointSize = 2 ;
@@ -50,8 +48,6 @@ const deselectHandler = () => {
5048
5149const scatterplot = createScatterplot ( {
5250 canvas,
53- width,
54- height,
5551 lassoMinDelay,
5652 lassoMinDist,
5753 pointSize,
@@ -64,13 +60,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
6460scatterplot . subscribe ( 'select' , selectHandler ) ;
6561scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
6662
67- const resizeHandler = ( ) => {
68- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
69- scatterplot . set ( { width, height } ) ;
70- } ;
71-
72- window . addEventListener ( 'resize' , resizeHandler ) ;
73-
7463const rndA = randomExponential ( 2 ) ;
7564const rndB = randomExponential ( 4 ) ;
7665const rndC = randomExponential ( 5 ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const exampleEl = document.querySelector('#example-background');
1616exampleEl . setAttribute ( 'class' , 'active' ) ;
1717exampleEl . removeAttribute ( 'href' ) ;
1818
19- let { width, height } = canvas . getBoundingClientRect ( ) ;
19+ const { width, height } = canvas . getBoundingClientRect ( ) ;
2020
2121let points = [ ] ;
2222let numPoints = 100000 ;
@@ -42,8 +42,6 @@ const deselectHandler = () => {
4242
4343const scatterplot = createScatterplot ( {
4444 canvas,
45- width,
46- height,
4745 pointSize,
4846 showRecticle : true ,
4947 backgroundImage : `https://picsum.photos/${ Math . min ( 640 , width ) } /${ Math . min (
@@ -57,13 +55,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
5755scatterplot . subscribe ( 'select' , selectHandler ) ;
5856scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
5957
60- const resizeHandler = ( ) => {
61- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
62- scatterplot . set ( { width, height } ) ;
63- } ;
64-
65- window . addEventListener ( 'resize' , resizeHandler ) ;
66-
6758const generatePoints = ( num ) =>
6859 new Array ( num ) . fill ( ) . map ( ( ) => [
6960 - 1 + Math . random ( ) * 2 , // x
Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ const exampleEl = document.querySelector('#example-transition');
1616exampleEl . setAttribute ( 'class' , 'active' ) ;
1717exampleEl . removeAttribute ( 'href' ) ;
1818
19- let { width, height } = canvas . getBoundingClientRect ( ) ;
20-
2119let points = [ ] ;
2220let pointStates = [ ] ;
2321let numPoints = 100000 ;
@@ -48,8 +46,6 @@ const deselectHandler = () => {
4846
4947const scatterplot = createScatterplot ( {
5048 canvas,
51- width,
52- height,
5349 lassoMinDelay,
5450 lassoMinDist,
5551 pointSize,
@@ -62,13 +58,6 @@ console.log(`Scatterplot v${scatterplot.get('version')}`);
6258scatterplot . subscribe ( 'select' , selectHandler ) ;
6359scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
6460
65- const resizeHandler = ( ) => {
66- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
67- scatterplot . set ( { width, height } ) ;
68- } ;
69-
70- window . addEventListener ( 'resize' , resizeHandler ) ;
71-
7261const generatePoints = ( num ) => [
7362 ...new Array ( Math . round ( num / 2 ) ) . fill ( ) . map ( ( ) => [
7463 - 1 + Math . random ( ) , // x
Original file line number Diff line number Diff line change @@ -28,8 +28,6 @@ exampleEl.setAttribute('class', 'active');
2828exampleEl . removeAttribute ( 'href' ) ;
2929
3030[ canvas1 , canvas2 ] . forEach ( ( canvas ) => {
31- let { width, height } = canvas . getBoundingClientRect ( ) ;
32-
3331 let points = [ ] ;
3432 let numPoints = 25000 ;
3533 let pointSize = 3 ;
@@ -54,8 +52,6 @@ exampleEl.removeAttribute('href');
5452
5553 const scatterplot = createScatterplot ( {
5654 canvas,
57- width,
58- height,
5955 pointSize,
6056 } ) ;
6157
@@ -64,13 +60,6 @@ exampleEl.removeAttribute('href');
6460 scatterplot . subscribe ( 'select' , selectHandler ) ;
6561 scatterplot . subscribe ( 'deselect' , deselectHandler ) ;
6662
67- const resizeHandler = ( ) => {
68- ( { width, height } = canvas . getBoundingClientRect ( ) ) ;
69- scatterplot . set ( { width, height } ) ;
70- } ;
71-
72- window . addEventListener ( 'resize' , resizeHandler ) ;
73-
7463 const generatePoints = ( num ) =>
7564 new Array ( num ) . fill ( ) . map ( ( ) => [
7665 - 1 + Math . random ( ) * 2 , // x
You can’t perform that action at this time.
0 commit comments