gridviz 3.0.15 → 3.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +127 -128
  2. package/dist/gridviz.js +7958 -7861
  3. package/dist/gridviz.min.js +1 -1
  4. package/package.json +74 -74
  5. package/src/button/ZoomButtons.js +101 -96
  6. package/src/core/Dataset.js +154 -157
  7. package/src/core/Drawable.js +60 -61
  8. package/src/core/GeoCanvas.js +409 -370
  9. package/src/core/Layer.js +23 -25
  10. package/src/core/Legend.js +108 -110
  11. package/src/core/Map.js +494 -495
  12. package/src/core/MultiResolutionDataset.js +93 -97
  13. package/src/core/Style.js +98 -99
  14. package/src/dataset/CSVGrid.js +112 -112
  15. package/src/dataset/GeoTIFF.js +122 -123
  16. package/src/dataset/JSGrid.js +55 -54
  17. package/src/dataset/TiledGrid.js +289 -288
  18. package/src/dataset/worker.js +18 -0
  19. package/src/index.js +77 -71
  20. package/src/layer/BackgroundLayer.js +162 -158
  21. package/src/layer/BackgroundLayerImage.js +81 -84
  22. package/src/layer/BackgroundLayerWMS.js +104 -108
  23. package/src/layer/GeoJSONLayer.js +214 -220
  24. package/src/layer/GridLayer.js +148 -157
  25. package/src/layer/LabelLayer.js +194 -193
  26. package/src/legend/ColorCategoryLegend.js +109 -110
  27. package/src/legend/ColorDiscreteLegend.js +100 -102
  28. package/src/legend/ColorLegend.js +115 -118
  29. package/src/legend/OrientationLegend.js +89 -91
  30. package/src/legend/SizeLegend.js +224 -224
  31. package/src/legend/TernaryLegend.js +302 -210
  32. package/src/style/CompositionStyle.js +291 -288
  33. package/src/style/DotDensityStyle.js +133 -134
  34. package/src/style/ImageStyle.js +100 -102
  35. package/src/style/IsoFenceStyle.js +217 -203
  36. package/src/style/JoyPlotStyle.js +127 -128
  37. package/src/style/LegoStyle.js +110 -110
  38. package/src/style/MosaicStyle.js +99 -99
  39. package/src/style/NinjaStarStyle.js +102 -102
  40. package/src/style/PillarStyle.js +207 -208
  41. package/src/style/SegmentStyle.js +105 -105
  42. package/src/style/ShapeColorSizeStyle.js +147 -132
  43. package/src/style/SideCategoryStyle.js +112 -114
  44. package/src/style/SideStyle.js +212 -205
  45. package/src/style/SquareColorCategoryWebGLStyle.js +107 -108
  46. package/src/style/SquareColorWebGLStyle.js +126 -126
  47. package/src/style/StrokeStyle.js +135 -136
  48. package/src/style/TanakaStyle.js +69 -68
  49. package/src/style/TextStyle.js +110 -111
  50. package/src/style/TimeSeriesStyle.js +222 -229
  51. package/src/utils/scale.js +218 -228
  52. package/src/utils/stretching.js +120 -133
  53. package/src/utils/ternary.js +203 -204
  54. package/src/utils/utils.js +58 -63
  55. package/src/utils/webGLUtils.js +72 -70
@@ -1,210 +1,302 @@
1
- //@ts-check
2
- 'use strict'
3
-
4
- import { select } from 'd3-selection'
5
- import { Legend } from '../core/Legend.js'
6
-
7
- /**
8
- *
9
- * @module legend
10
- * @author Julien Gaffuri
11
- */
12
- export class TernaryLegend extends Legend {
13
- /** @param {Object} opts */
14
- constructor(opts) {
15
- super(opts)
16
- opts = opts || {}
17
-
18
- //classifier
19
- this.classifier = opts.classifier
20
-
21
- this.width = opts.width || 150
22
- this.selectionColor = this.selectionColor || "red"
23
- this.tooltip = opts.tooltip
24
- this.texts = opts.texts
25
-
26
- this.leftText = opts.leftText || "Category 0"
27
- this.topText = opts.topText || "Category 1"
28
- this.rightText = opts.rightText || "Category 2"
29
-
30
- this.centerCoefficient = opts.centerCoefficient || this.classifier.centerCoefficient
31
- }
32
-
33
- /**
34
- * @param {{} } opts
35
- */
36
- update(opts) {
37
-
38
- //clear
39
- this.div.selectAll('*').remove()
40
-
41
- //title
42
- this.makeTitle()
43
-
44
- const sqrt3over2 = 0.866025
45
- const w = this.width, h = w * sqrt3over2
46
- const classifier = this.classifier
47
- const selectionColor = this.selectionColor
48
- const selectionStrokeWidth = 0
49
- const tt = this.tooltip
50
- const texts = this.texts || {}
51
-
52
- const padding = 2
53
- const fontSize = 12
54
-
55
- //make svg element
56
- const svg = this.div
57
- .append('svg')
58
- .attr('width', w + selectionStrokeWidth)
59
- .attr('height', h + 4 * padding + 2 * fontSize)
60
-
61
- //top label
62
- svg.append("text").attr("x", w / 2).attr("y", padding + fontSize).text(this.topText).attr("font-size", fontSize)
63
- .attr("text-anchor", "middle")
64
- //left label
65
- svg.append("text").attr("x", 0).attr("y", 3 * padding + 2 * fontSize + h).text(this.leftText).attr("font-size", fontSize)
66
- .attr("text-anchor", "start")
67
- //right label
68
- svg.append("text").attr("x", w).attr("y", 3 * padding + 2 * fontSize + h).text(this.rightText).attr("font-size", fontSize)
69
- .attr("text-anchor", "end")
70
-
71
-
72
-
73
- //triangle group
74
- const g = svg.append("g").attr("transform", "translate(" + (selectionStrokeWidth / 2) + " " + (selectionStrokeWidth / 2 + (2 * padding + fontSize)) + ")")
75
-
76
- //common function for triangle patches
77
- const setAttributes = (elt, color, text) => {
78
- //elt.raise();
79
- elt.attr('fill', color)
80
- //.attr("stroke", colorOver)
81
- //.attr("stroke-width", 0)
82
- //.attr("stroke-linejoin", "round")
83
- .on("mouseover", function (e) {
84
- /*this.parentNode.appendChild(this); select(this).attr("stroke-width", selectionStrokeWidth);*/
85
- select(this).attr('fill', selectionColor);
86
- if (!tt || !text) return;
87
- tt.html(text);
88
- tt.setPosition(e);
89
- tt.show()
90
- })
91
- .on("mouseout", function () {
92
- /*select(this).attr("stroke-width", 0);*/
93
- select(this).attr('fill', color);
94
- if (tt) tt.hide()
95
- })
96
- if (tt && text) elt.on("mousemove", function (e) { tt.setPosition(e) })
97
- }
98
-
99
- //const [c0, c1, c2] = classifier.center
100
-
101
- //trapezium s0
102
- const t0 = g.append('polygon')
103
- .attr('points', "0," + h + " " + w / 3 + "," + h + " " + w / 2 + "," + h * 2 / 3 + " " + w / 6 + "," + h * 2 / 3)
104
- setAttributes(t0, classifier.colors[0], texts["0"])
105
- //trapezium s1
106
- const t1 = g.append('polygon')
107
- .attr('points', w / 2 + ",0 " + w * 2 / 3 + "," + h / 3 + " " + w / 2 + "," + h * 2 / 3 + " " + w / 3 + "," + h / 3)
108
- setAttributes(t1, classifier.colors[1], texts["1"])
109
- //trapezium s2
110
- const t2 = g.append('polygon')
111
- .attr('points', w + "," + h + " " + w * 5 / 6 + "," + 2 * h / 3 + " " + w / 2 + "," + h * 2 / 3 + " " + w * 2 / 3 + "," + h)
112
- setAttributes(t2, classifier.colors[2], texts["2"])
113
- //triangle s0
114
- const t0_ = g.append('polygon')
115
- .attr('points', w / 2 + "," + h * 2 / 3 + " " + w * 5 / 6 + "," + h * 2 / 3 + " " + w * 2 / 3 + "," + h / 3)
116
- setAttributes(t0_, classifier.mixColors[0], texts["m12"])
117
- //triangle s1
118
- const t1_ = g.append('polygon')
119
- .attr('points', w / 2 + "," + h * 2 / 3 + " " + w / 3 + "," + h + " " + w * 2 / 3 + "," + h)
120
- setAttributes(t1_, classifier.mixColors[1], texts["m02"])
121
- //triangle s2
122
- const t2_ = g.append('polygon')
123
- .attr('points', w / 2 + "," + h * 2 / 3 + " " + w / 6 + "," + h * 2 / 3 + " " + w / 3 + "," + h / 3)
124
- setAttributes(t2_, classifier.mixColors[2], texts["m01"])
125
-
126
- //center
127
- if (this.centerCoefficient) {
128
- //TODO make it an hexagon !
129
- const center = g.append('circle')
130
- .attr('cx', w / 2).attr('cy', h * 2 / 3)
131
- .attr('r', this.centerCoefficient * h / 3)
132
- setAttributes(center, classifier.centerColor, texts["center"])
133
- }
134
-
135
-
136
- /*
137
- let middle, left, top, right, left_, bottom_, right_
138
- if (!this.real) {
139
-
140
- //0 left triangle
141
- left = g.append('polygon')
142
- .attr('points', "0," + h + " " + (w / 3) + "," + h + " " + (w / 6) + "," + (2 * h / 3))
143
- //1 top triangle
144
- top = g.append('polygon')
145
- .attr('points', (w / 3) + "," + (h / 3) + " " + (w * 2 / 3) + "," + (h / 3) + " " + (w / 2) + ",0")
146
- //2 right triangle
147
- right = g.append('polygon')
148
- .attr('points', (w * 2 / 3) + "," + h + " " + w + "," + h + " " + (w * 5 / 6) + "," + (2 * h / 3))
149
- //middle triangle
150
- middle = g.append('polygon')
151
- .attr('points', (w / 2) + "," + (h / 3) + " " + (w / 4) + "," + (h * 5 / 6) + " " + (3 * w / 4) + "," + (h * 5 / 6))
152
- //01 left trapezium
153
- left_ = g.append('polygon')
154
- .attr('points', (w / 6) + "," + (h * 2 / 3) + " " + (w / 4) + "," + (h * 5 / 6) + " " + (w / 2) + "," + (h / 3) + " " + (w / 3) + "," + (h / 3))
155
- //02 bottom trapezium
156
- bottom_ = g.append('polygon')
157
- .attr('points', (w / 3) + "," + (h) + " " + (2 * w / 3) + "," + (h) + " " + (w * 3 / 4) + "," + (h * 5 / 6) + " " + (w / 4) + "," + (h * 5 / 6))
158
- //12 right trapezium
159
- right_ = g.append('polygon')
160
- .attr('points', (w / 2) + "," + (h / 3) + " " + (w * 3 / 4) + "," + (h * 5 / 6) + " " + (w * 5 / 6) + "," + (h * 2 / 3) + " " + (w * 2 / 3) + "," + (h / 3))
161
-
162
- } else {
163
-
164
- //middle triangle
165
- middle = g.append('polygon')
166
- .attr('points', (w / 2) + ",0 0," + h + " " + w + "," + h)
167
-
168
- //draw trapezium
169
- //draw large trapezium first
170
- for (let i_ = 2; i_ >= 0; i_--) {
171
- const i = this.classifier.lowIndex[i_]
172
- const r = this.classifier.lowThreshold[i]
173
- if (i == 2)
174
- //01 left trapezium
175
- left_ = g.append('polygon')
176
- .attr('points', w / 2 + ",0 0," + h + " " + w * r + "," + h + " " + w * (1 + r) / 2 + "," + r * h)
177
- else if (i == 1)
178
- //02 bottom trapezium
179
- bottom_ = g.append('polygon')
180
- .attr('points', "0," + h + " " + w + "," + h + " " + w * (1 - r / 2) + "," + h * (1 - r) + " " + r * w / 2 + "," + h * (1 - r))
181
- else
182
- //12 right trapezium
183
- right_ = g.append('polygon')
184
- .attr('points', w + "," + h + " " + w / 2 + ",0 " + w * (1 - r) / 2 + "," + h * r + " " + w * (1 - r) + "," + h)
185
- }
186
-
187
- //draw triangles
188
- //draw large triangles first
189
- for (let i_ = 2; i_ >= 0; i_--) {
190
- const i = this.classifier.highIndex[i_]
191
- const r = this.classifier.highThreshold[i]
192
-
193
- if (i == 2)
194
- //2 right triangle
195
- right = g.append('polygon')
196
- .attr('points', w + "," + h + " " + w * r + "," + h + " " + w * (1 + r) / 2 + "," + h * r)
197
- else if (i == 1)
198
- //1 top triangle
199
- top = g.append('polygon')
200
- .attr('points', (w / 2) + ",0 " + w * r / 2 + "," + h * (1 - r) + " " + w * (1 - r / 2) + "," + h * (1 - r))
201
- else
202
- //0 left triangle
203
- left = g.append('polygon')
204
- .attr('points', "0," + h + " " + w * (1 - r) + "," + h + " " + w * (1 - r) / 2 + "," + h * r)
205
- }
206
-
207
- }*/
208
-
209
- }
210
- }
1
+ //@ts-check
2
+ 'use strict'
3
+
4
+ import { select } from 'd3-selection'
5
+ import { Legend } from '../core/Legend.js'
6
+
7
+ /**
8
+ *
9
+ * @module legend
10
+ * @author Julien Gaffuri
11
+ */
12
+ export class TernaryLegend extends Legend {
13
+ /** @param {Object} opts */
14
+ constructor(opts) {
15
+ super(opts)
16
+ opts = opts || {}
17
+
18
+ //classifier
19
+ this.classifier = opts.classifier
20
+
21
+ this.width = opts.width || 150
22
+ this.selectionColor = this.selectionColor || 'red'
23
+ this.tooltip = opts.tooltip
24
+ this.texts = opts.texts
25
+
26
+ this.leftText = opts.leftText || 'Category 0'
27
+ this.topText = opts.topText || 'Category 1'
28
+ this.rightText = opts.rightText || 'Category 2'
29
+
30
+ this.centerCoefficient = opts.centerCoefficient || this.classifier.centerCoefficient
31
+ }
32
+
33
+ /**
34
+ * @param {{} } opts
35
+ */
36
+ update(opts) {
37
+ //clear
38
+ this.div.selectAll('*').remove()
39
+
40
+ //title
41
+ this.makeTitle()
42
+
43
+ const sqrt3over2 = 0.866025
44
+ const w = this.width,
45
+ h = w * sqrt3over2
46
+ const classifier = this.classifier
47
+ const selectionColor = this.selectionColor
48
+ const selectionStrokeWidth = 0
49
+ const tt = this.tooltip
50
+ const texts = this.texts || {}
51
+
52
+ const padding = 2
53
+ const fontSize = 12
54
+
55
+ //make svg element
56
+ const svg = this.div
57
+ .append('svg')
58
+ .attr('width', w + selectionStrokeWidth)
59
+ .attr('height', h + 4 * padding + 2 * fontSize)
60
+
61
+ //top label
62
+ svg.append('text')
63
+ .attr('x', w / 2)
64
+ .attr('y', padding + fontSize)
65
+ .text(this.topText)
66
+ .attr('font-size', fontSize)
67
+ .attr('text-anchor', 'middle')
68
+ //left label
69
+ svg.append('text')
70
+ .attr('x', 0)
71
+ .attr('y', 3 * padding + 2 * fontSize + h)
72
+ .text(this.leftText)
73
+ .attr('font-size', fontSize)
74
+ .attr('text-anchor', 'start')
75
+ //right label
76
+ svg.append('text')
77
+ .attr('x', w)
78
+ .attr('y', 3 * padding + 2 * fontSize + h)
79
+ .text(this.rightText)
80
+ .attr('font-size', fontSize)
81
+ .attr('text-anchor', 'end')
82
+
83
+ //triangle group
84
+ const g = svg
85
+ .append('g')
86
+ .attr(
87
+ 'transform',
88
+ 'translate(' +
89
+ selectionStrokeWidth / 2 +
90
+ ' ' +
91
+ (selectionStrokeWidth / 2 + (2 * padding + fontSize)) +
92
+ ')'
93
+ )
94
+
95
+ //common function for triangle patches
96
+ const setAttributes = (elt, color, text) => {
97
+ //elt.raise();
98
+ elt.attr('fill', color)
99
+ //.attr("stroke", colorOver)
100
+ //.attr("stroke-width", 0)
101
+ //.attr("stroke-linejoin", "round")
102
+ .on('mouseover', function (e) {
103
+ /*this.parentNode.appendChild(this); select(this).attr("stroke-width", selectionStrokeWidth);*/
104
+ select(this).attr('fill', selectionColor)
105
+ if (!tt || !text) return
106
+ tt.html(text)
107
+ tt.setPosition(e)
108
+ tt.show()
109
+ })
110
+ .on('mouseout', function () {
111
+ /*select(this).attr("stroke-width", 0);*/
112
+ select(this).attr('fill', color)
113
+ if (tt) tt.hide()
114
+ })
115
+ if (tt && text)
116
+ elt.on('mousemove', function (e) {
117
+ tt.setPosition(e)
118
+ })
119
+ }
120
+
121
+ //const [c0, c1, c2] = classifier.center
122
+
123
+ //trapezium s0
124
+ const t0 = g
125
+ .append('polygon')
126
+ .attr(
127
+ 'points',
128
+ '0,' +
129
+ h +
130
+ ' ' +
131
+ w / 3 +
132
+ ',' +
133
+ h +
134
+ ' ' +
135
+ w / 2 +
136
+ ',' +
137
+ (h * 2) / 3 +
138
+ ' ' +
139
+ w / 6 +
140
+ ',' +
141
+ (h * 2) / 3
142
+ )
143
+ setAttributes(t0, classifier.colors[0], texts['0'])
144
+ //trapezium s1
145
+ const t1 = g
146
+ .append('polygon')
147
+ .attr(
148
+ 'points',
149
+ w / 2 +
150
+ ',0 ' +
151
+ (w * 2) / 3 +
152
+ ',' +
153
+ h / 3 +
154
+ ' ' +
155
+ w / 2 +
156
+ ',' +
157
+ (h * 2) / 3 +
158
+ ' ' +
159
+ w / 3 +
160
+ ',' +
161
+ h / 3
162
+ )
163
+ setAttributes(t1, classifier.colors[1], texts['1'])
164
+ //trapezium s2
165
+ const t2 = g
166
+ .append('polygon')
167
+ .attr(
168
+ 'points',
169
+ w +
170
+ ',' +
171
+ h +
172
+ ' ' +
173
+ (w * 5) / 6 +
174
+ ',' +
175
+ (2 * h) / 3 +
176
+ ' ' +
177
+ w / 2 +
178
+ ',' +
179
+ (h * 2) / 3 +
180
+ ' ' +
181
+ (w * 2) / 3 +
182
+ ',' +
183
+ h
184
+ )
185
+ setAttributes(t2, classifier.colors[2], texts['2'])
186
+ //triangle s0
187
+ const t0_ = g
188
+ .append('polygon')
189
+ .attr(
190
+ 'points',
191
+ w / 2 +
192
+ ',' +
193
+ (h * 2) / 3 +
194
+ ' ' +
195
+ (w * 5) / 6 +
196
+ ',' +
197
+ (h * 2) / 3 +
198
+ ' ' +
199
+ (w * 2) / 3 +
200
+ ',' +
201
+ h / 3
202
+ )
203
+ setAttributes(t0_, classifier.mixColors[0], texts['m12'])
204
+ //triangle s1
205
+ const t1_ = g
206
+ .append('polygon')
207
+ .attr('points', w / 2 + ',' + (h * 2) / 3 + ' ' + w / 3 + ',' + h + ' ' + (w * 2) / 3 + ',' + h)
208
+ setAttributes(t1_, classifier.mixColors[1], texts['m02'])
209
+ //triangle s2
210
+ const t2_ = g
211
+ .append('polygon')
212
+ .attr(
213
+ 'points',
214
+ w / 2 + ',' + (h * 2) / 3 + ' ' + w / 6 + ',' + (h * 2) / 3 + ' ' + w / 3 + ',' + h / 3
215
+ )
216
+ setAttributes(t2_, classifier.mixColors[2], texts['m01'])
217
+
218
+ //center
219
+ if (this.centerCoefficient) {
220
+ //TODO make it an hexagon !
221
+ const center = g
222
+ .append('circle')
223
+ .attr('cx', w / 2)
224
+ .attr('cy', (h * 2) / 3)
225
+ .attr('r', (this.centerCoefficient * h) / 3)
226
+ setAttributes(center, classifier.centerColor, texts['center'])
227
+ }
228
+
229
+ /*
230
+ let middle, left, top, right, left_, bottom_, right_
231
+ if (!this.real) {
232
+
233
+ //0 left triangle
234
+ left = g.append('polygon')
235
+ .attr('points', "0," + h + " " + (w / 3) + "," + h + " " + (w / 6) + "," + (2 * h / 3))
236
+ //1 top triangle
237
+ top = g.append('polygon')
238
+ .attr('points', (w / 3) + "," + (h / 3) + " " + (w * 2 / 3) + "," + (h / 3) + " " + (w / 2) + ",0")
239
+ //2 right triangle
240
+ right = g.append('polygon')
241
+ .attr('points', (w * 2 / 3) + "," + h + " " + w + "," + h + " " + (w * 5 / 6) + "," + (2 * h / 3))
242
+ //middle triangle
243
+ middle = g.append('polygon')
244
+ .attr('points', (w / 2) + "," + (h / 3) + " " + (w / 4) + "," + (h * 5 / 6) + " " + (3 * w / 4) + "," + (h * 5 / 6))
245
+ //01 left trapezium
246
+ left_ = g.append('polygon')
247
+ .attr('points', (w / 6) + "," + (h * 2 / 3) + " " + (w / 4) + "," + (h * 5 / 6) + " " + (w / 2) + "," + (h / 3) + " " + (w / 3) + "," + (h / 3))
248
+ //02 bottom trapezium
249
+ bottom_ = g.append('polygon')
250
+ .attr('points', (w / 3) + "," + (h) + " " + (2 * w / 3) + "," + (h) + " " + (w * 3 / 4) + "," + (h * 5 / 6) + " " + (w / 4) + "," + (h * 5 / 6))
251
+ //12 right trapezium
252
+ right_ = g.append('polygon')
253
+ .attr('points', (w / 2) + "," + (h / 3) + " " + (w * 3 / 4) + "," + (h * 5 / 6) + " " + (w * 5 / 6) + "," + (h * 2 / 3) + " " + (w * 2 / 3) + "," + (h / 3))
254
+
255
+ } else {
256
+
257
+ //middle triangle
258
+ middle = g.append('polygon')
259
+ .attr('points', (w / 2) + ",0 0," + h + " " + w + "," + h)
260
+
261
+ //draw trapezium
262
+ //draw large trapezium first
263
+ for (let i_ = 2; i_ >= 0; i_--) {
264
+ const i = this.classifier.lowIndex[i_]
265
+ const r = this.classifier.lowThreshold[i]
266
+ if (i == 2)
267
+ //01 left trapezium
268
+ left_ = g.append('polygon')
269
+ .attr('points', w / 2 + ",0 0," + h + " " + w * r + "," + h + " " + w * (1 + r) / 2 + "," + r * h)
270
+ else if (i == 1)
271
+ //02 bottom trapezium
272
+ bottom_ = g.append('polygon')
273
+ .attr('points', "0," + h + " " + w + "," + h + " " + w * (1 - r / 2) + "," + h * (1 - r) + " " + r * w / 2 + "," + h * (1 - r))
274
+ else
275
+ //12 right trapezium
276
+ right_ = g.append('polygon')
277
+ .attr('points', w + "," + h + " " + w / 2 + ",0 " + w * (1 - r) / 2 + "," + h * r + " " + w * (1 - r) + "," + h)
278
+ }
279
+
280
+ //draw triangles
281
+ //draw large triangles first
282
+ for (let i_ = 2; i_ >= 0; i_--) {
283
+ const i = this.classifier.highIndex[i_]
284
+ const r = this.classifier.highThreshold[i]
285
+
286
+ if (i == 2)
287
+ //2 right triangle
288
+ right = g.append('polygon')
289
+ .attr('points', w + "," + h + " " + w * r + "," + h + " " + w * (1 + r) / 2 + "," + h * r)
290
+ else if (i == 1)
291
+ //1 top triangle
292
+ top = g.append('polygon')
293
+ .attr('points', (w / 2) + ",0 " + w * r / 2 + "," + h * (1 - r) + " " + w * (1 - r / 2) + "," + h * (1 - r))
294
+ else
295
+ //0 left triangle
296
+ left = g.append('polygon')
297
+ .attr('points', "0," + h + " " + w * (1 - r) + "," + h + " " + w * (1 - r) / 2 + "," + h * r)
298
+ }
299
+
300
+ }*/
301
+ }
302
+ }