Skip to content

Commit 5d2add8

Browse files
Copilotgatopeich
andauthored
Address PR plotly#7653 review comments: restore symDef.n, rename/clean demos, add marker visual regression page (#12)
* Initial plan * Address review comments: rename demos, restore symDef.n, add marker comparison page Co-authored-by: gatopeich <7722268+gatopeich@users.noreply.github.com> Agent-Logs-Url: https://github.com/gatopeich/plotly.js/sessions/606bb8e7-b426-43ec-95fa-94f5c3615a59 * Delete devtools/demos/marker_comparison.html Dont commit marker comparison (will attach to PR instead) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: gatopeich <7722268+gatopeich@users.noreply.github.com>
1 parent c74c81d commit 5d2add8

File tree

4 files changed

+56
-66
lines changed

4 files changed

+56
-66
lines changed

devtools/demos/backward_compatibility_test.html

Lines changed: 0 additions & 64 deletions
This file was deleted.

src/components/drawing/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,9 @@ drawing.symbolNoDot = {};
338338
drawing.symbolNoFill = {};
339339
drawing.symbolList = [];
340340

341-
var _n = 0;
342341
Object.keys(SYMBOLDEFS).forEach(function (k) {
343342
var symDef = SYMBOLDEFS[k];
344-
var n = _n++;
343+
var n = symDef.n;
345344
drawing.symbolList.push(
346345
n,
347346
String(n),

src/components/drawing/symbol_defs.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,233 +13,288 @@
1313

1414
module.exports = {
1515
circle: {
16+
n: 0,
1617
p: 'M20,0A20,20 0 1,1 0,-20A20,20 0 0,1 20,0Z'
1718
},
1819
square: {
20+
n: 1,
1921
p: 'M20,20H-20V-20H20Z'
2022
},
2123
diamond: {
24+
n: 2,
2225
p: 'M26,0L0,26L-26,0L0,-26Z'
2326
},
2427
cross: {
28+
n: 3,
2529
p: 'M24,8H8V24H-8V8H-24V-8H-8V-24H8V-8H24Z'
2630
},
2731
x: {
32+
n: 4,
2833
p: 'M0,11l11,11l11,-11l-11,-11l11,-11l-11,-11l-11,11l-11,-11l-11,11l11,11l-11,11l11,11Z'
2934
},
3035
'triangle-up': {
36+
n: 5,
3137
p: 'M-23,10H23L0,-20Z'
3238
},
3339
'triangle-down': {
40+
n: 6,
3441
p: 'M-23,-10H23L0,20Z'
3542
},
3643
'triangle-left': {
44+
n: 7,
3745
p: 'M10,-23V23L-20,0Z'
3846
},
3947
'triangle-right': {
48+
n: 8,
4049
p: 'M-10,-23V23L20,0Z'
4150
},
4251
'triangle-ne': {
52+
n: 9,
4353
p: 'M-24,-12H12V24Z'
4454
},
4555
'triangle-se': {
56+
n: 10,
4657
p: 'M12,-24V12H-24Z'
4758
},
4859
'triangle-sw': {
60+
n: 11,
4961
p: 'M24,12H-12V-24Z'
5062
},
5163
'triangle-nw': {
64+
n: 12,
5265
p: 'M-12,24V-12H24Z'
5366
},
5467
pentagon: {
68+
n: 13,
5569
p: 'M19,-6L12,16H-12L-19,-6L0,-20Z'
5670
},
5771
hexagon: {
72+
n: 14,
5873
p: 'M17,-10V10L0,20L-17,10V-10L0,-20Z'
5974
},
6075
hexagon2: {
76+
n: 15,
6177
p: 'M-10,17H10L20,0L10,-17H-10L-20,0Z'
6278
},
6379
octagon: {
80+
n: 16,
6481
p: 'M-8,-18H8L18,-8V8L8,18H-8L-18,8V-8Z'
6582
},
6683
star: {
84+
n: 17,
6785
p: 'M6,-9H27L10,3L16,23L0,11L-16,23L-10,3L-27,-9H-6L0,-28Z'
6886
},
6987
hexagram: {
88+
n: 18,
7089
p: 'M-15,0l-8,-13h15l8,-13l8,13h15l-8,13l8,13h-15l-8,13l-8,-13h-15Z'
7190
},
7291
'star-triangle-up': {
92+
n: 19,
7393
p: 'M-28,16A80,80 0 0 1 28,16A80,80 0 0 1 0,-32A80,80 0 0 1 -28,16Z'
7494
},
7595
'star-triangle-down': {
96+
n: 20,
7697
p: 'M28,-16A80,80 0 0 1 -28,-16A80,80 0 0 1 0,32A80,80 0 0 1 28,-16Z'
7798
},
7899
'star-square': {
100+
n: 21,
79101
p: 'M-22,-22A40,40 0 0 1 -22,22A40,40 0 0 1 22,22A40,40 0 0 1 22,-22A40,40 0 0 1 -22,-22Z'
80102
},
81103
'star-diamond': {
104+
n: 22,
82105
p: 'M-28,0A38,38 0 0 1 0,28A38,38 0 0 1 28,0A38,38 0 0 1 0,-28A38,38 0 0 1 -28,0Z'
83106
},
84107
'diamond-tall': {
108+
n: 23,
85109
p: 'M0,28L14,0L0,-28L-14,0Z'
86110
},
87111
'diamond-wide': {
112+
n: 24,
88113
p: 'M0,14L28,0L0,-14L-28,0Z'
89114
},
90115
hourglass: {
116+
n: 25,
91117
p: 'M20,20H-20L20,-20H-20Z',
92118
noDot: true
93119
},
94120
bowtie: {
121+
n: 26,
95122
p: 'M20,20V-20L-20,20V-20Z',
96123
noDot: true
97124
},
98125
'circle-cross': {
126+
n: 27,
99127
p: 'M0,20V-20M20,0H-20M20,0A20,20 0 1,1 0,-20A20,20 0 0,1 20,0Z',
100128
needLine: true,
101129
noDot: true
102130
},
103131
'circle-x': {
132+
n: 28,
104133
p: 'M14,14L-14,-14M14,-14L-14,14M20,0A20,20 0 1,1 0,-20A20,20 0 0,1 20,0Z',
105134
needLine: true,
106135
noDot: true
107136
},
108137
'square-cross': {
138+
n: 29,
109139
p: 'M0,20V-20M20,0H-20M20,20H-20V-20H20Z',
110140
needLine: true,
111141
noDot: true
112142
},
113143
'square-x': {
144+
n: 30,
114145
p: 'M20,20L-20,-20M20,-20L-20,20M20,20H-20V-20H20Z',
115146
needLine: true,
116147
noDot: true
117148
},
118149
'diamond-cross': {
150+
n: 31,
119151
p: 'M26,0L0,26L-26,0L0,-26ZM0,-26V26M-26,0H26',
120152
needLine: true,
121153
noDot: true
122154
},
123155
'diamond-x': {
156+
n: 32,
124157
p: 'M26,0L0,26L-26,0L0,-26ZM-13,-13L13,13M-13,13L13,-13',
125158
needLine: true,
126159
noDot: true
127160
},
128161
'cross-thin': {
162+
n: 33,
129163
p: 'M0,28V-28M28,0H-28',
130164
needLine: true,
131165
noDot: true,
132166
noFill: true
133167
},
134168
'x-thin': {
169+
n: 34,
135170
p: 'M20,20L-20,-20M20,-20L-20,20',
136171
needLine: true,
137172
noDot: true,
138173
noFill: true
139174
},
140175
asterisk: {
176+
n: 35,
141177
p: 'M0,24V-24M24,0H-24M17,17L-17,-17M17,-17L-17,17',
142178
needLine: true,
143179
noDot: true,
144180
noFill: true
145181
},
146182
hash: {
183+
n: 36,
147184
p: 'M10,20V-20M-10,-20V20M20,10H-20M-20,-10H20',
148185
needLine: true,
149186
noFill: true
150187
},
151188
'y-up': {
189+
n: 37,
152190
p: 'M-24,16L0,0M24,16L0,0M0,-32L0,0',
153191
needLine: true,
154192
noDot: true,
155193
noFill: true
156194
},
157195
'y-down': {
196+
n: 38,
158197
p: 'M-24,-16L0,0M24,-16L0,0M0,32L0,0',
159198
needLine: true,
160199
noDot: true,
161200
noFill: true
162201
},
163202
'y-left': {
203+
n: 39,
164204
p: 'M16,24L0,0M16,-24L0,0M-32,0L0,0',
165205
needLine: true,
166206
noDot: true,
167207
noFill: true
168208
},
169209
'y-right': {
210+
n: 40,
170211
p: 'M-16,24L0,0M-16,-24L0,0M32,0L0,0',
171212
needLine: true,
172213
noDot: true,
173214
noFill: true
174215
},
175216
'line-ew': {
217+
n: 41,
176218
p: 'M28,0H-28',
177219
needLine: true,
178220
noDot: true,
179221
noFill: true
180222
},
181223
'line-ns': {
224+
n: 42,
182225
p: 'M0,28V-28',
183226
needLine: true,
184227
noDot: true,
185228
noFill: true
186229
},
187230
'line-ne': {
231+
n: 43,
188232
p: 'M20,-20L-20,20',
189233
needLine: true,
190234
noDot: true,
191235
noFill: true
192236
},
193237
'line-nw': {
238+
n: 44,
194239
p: 'M20,20L-20,-20',
195240
needLine: true,
196241
noDot: true,
197242
noFill: true
198243
},
199244
'arrow-up': {
245+
n: 45,
200246
p: 'M0,0L-20,40H20Z',
201247
backoff: 1,
202248
noDot: true
203249
},
204250
'arrow-down': {
251+
n: 46,
205252
p: 'M0,0L-20,-40H20Z',
206253
noDot: true
207254
},
208255
'arrow-left': {
256+
n: 47,
209257
p: 'M0,0L40,-20V20Z',
210258
noDot: true
211259
},
212260
'arrow-right': {
261+
n: 48,
213262
p: 'M0,0L-40,-20V20Z',
214263
noDot: true
215264
},
216265
'arrow-bar-up': {
266+
n: 49,
217267
p: 'M-20,0H20M0,0L-20,40H20Z',
218268
backoff: 1,
219269
needLine: true,
220270
noDot: true
221271
},
222272
'arrow-bar-down': {
273+
n: 50,
223274
p: 'M-20,0H20M0,0L-20,-40H20Z',
224275
needLine: true,
225276
noDot: true
226277
},
227278
'arrow-bar-left': {
279+
n: 51,
228280
p: 'M0,-20V20M0,0L40,-20V20Z',
229281
needLine: true,
230282
noDot: true
231283
},
232284
'arrow-bar-right': {
285+
n: 52,
233286
p: 'M0,-20V20M0,0L-40,-20V20Z',
234287
needLine: true,
235288
noDot: true
236289
},
237290
arrow: {
291+
n: 53,
238292
p: 'M0,0L-12,38L12,38Z',
239293
backoff: 0.9,
240294
noDot: true
241295
},
242296
'arrow-wide': {
297+
n: 54,
243298
p: 'M0,0L-28,28A40,40 0 0 1 28,28Z',
244299
backoff: 0.4,
245300
noDot: true

0 commit comments

Comments
 (0)