Skip to content

Commit 5522b91

Browse files
committed
fix scattercarpet attr description + add mock with mode:text
1 parent 12097a2 commit 5522b91

File tree

3 files changed

+62
-16
lines changed

3 files changed

+62
-16
lines changed

src/traces/scattercarpet/attributes.js

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,26 @@ module.exports = {
3434
a: {
3535
valType: 'data_array',
3636
editType: 'calc',
37-
description: [
38-
'Sets the quantity of component `a` in each data point.',
39-
'If `a`, `b`, and `c` are all provided, they need not be',
40-
'normalized, only the relative values matter. If only two',
41-
'arrays are provided they must be normalized to match',
42-
'`ternary<i>.sum`.'
43-
].join(' ')
37+
description: 'Sets the a-axis coordinates.'
4438
},
4539
b: {
4640
valType: 'data_array',
4741
editType: 'calc',
48-
description: [
49-
'Sets the quantity of component `a` in each data point.',
50-
'If `a`, `b`, and `c` are all provided, they need not be',
51-
'normalized, only the relative values matter. If only two',
52-
'arrays are provided they must be normalized to match',
53-
'`ternary<i>.sum`.'
54-
].join(' ')
42+
description: 'Sets the b-axis coordinates.'
5543
},
5644
mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}),
5745
text: extendFlat({}, scatterAttrs.text, {
5846
description: [
59-
'Sets text elements associated with each (a,b,c) point.',
47+
'Sets text elements associated with each (a,b) point.',
48+
'If a single string, the same string appears over',
49+
'all the data points.',
50+
'If an array of strings, the items are mapped in order to the',
51+
'the data points in (a,b).',
52+
'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',
53+
'these elements will be seen in the hover labels.'
6054
'If a single string, the same string appears over',
6155
'all the data points.',
6256
'If an array of strings, the items are mapped in order to the',
63-
'the data points in (a,b,c).'
6457
].join(' ')
6558
}),
6659
line: {
36.1 KB
Loading
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"data": [
3+
{
4+
"type": "carpet",
5+
"a": [0.1, 0.2, 0.3],
6+
"b": [1, 2, 3],
7+
"y": [
8+
[1, 2.2, 3],
9+
[1.5, 2.7, 3.5],
10+
[1.7, 2.9, 3.7]
11+
],
12+
"cheaterslope": 1,
13+
"aaxis": {
14+
"title": "a",
15+
"tickmode": "linear",
16+
"dtick": 0.05
17+
},
18+
"baxis": {
19+
"title": "b",
20+
"tickmode": "linear",
21+
"dtick": 0.5
22+
}
23+
},
24+
{
25+
"type": "scattercarpet",
26+
"name": "b = 1.5",
27+
"mode": "markers+text",
28+
"a": [0.05, 0.15, 0.25, 0.35],
29+
"b": [1.5, 1.5, 1.5, 1.5],
30+
"text": ["a", "b", "c", "d"]
31+
},
32+
{
33+
"type": "scattercarpet",
34+
"name": "b = 2",
35+
"mode": "markers+lines+text",
36+
"a": [0.05, 0.15, 0.25, 0.35],
37+
"b": [2, 2, 2, 2],
38+
"text": ["a", "b", "c", "d"]
39+
},
40+
{
41+
"type": "scattercarpet",
42+
"name": "b = 2.5",
43+
"mode": "text",
44+
"a": [0.05, 0.15, 0.25, 0.35],
45+
"b": [2.5, 2.5, 2.5, 2.5],
46+
"text": ["a", "b", "c", "d"]
47+
}
48+
],
49+
"layout": {
50+
"title": "scattercarpet with text",
51+
"hovermode": "closest"
52+
}
53+
}

0 commit comments

Comments
 (0)