Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add options to include shapes and newshape in legends #6653

Merged
merged 30 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6545353
register legends after shapes
archmoj Jun 27, 2023
786d9e6
add options to include shapes in legends
archmoj Jun 27, 2023
2d7d3da
test clicking shape legends
archmoj Jun 28, 2023
332a0dd
draftlog
archmoj Jun 28, 2023
8a0f60a
improve descriptions
archmoj Jun 28, 2023
f0c6b72
add comments to core.js about order of registering components
archmoj Jun 29, 2023
d3004c1
use hexagon2 for path symbols
archmoj Jun 29, 2023
51a28f9
use overrideAll in newshape and fix bundling issue
archmoj Jun 29, 2023
0fa6914
Merge branch 'master' into shape-legends
archmoj Jun 30, 2023
4728e86
Merge remote-tracking branch 'origin/master' into shape-legends
archmoj Jul 4, 2023
2f1f812
Merge remote-tracking branch 'origin/master' into shape-legends
archmoj Jul 5, 2023
3511eb4
test showing shapes in groups
archmoj Jul 5, 2023
8e181cc
rename vars to point to data updates
archmoj Jul 6, 2023
6c0ab2e
handle shape legends group click
archmoj Jul 6, 2023
7870720
avoid unrecognized messages on click
archmoj Jul 7, 2023
ef0fe6f
add grouptitle and handle click
archmoj Jul 7, 2023
2e77fc7
test legendrank
archmoj Jul 7, 2023
58b1cb1
mention traces and shapes order in legendrank description
archmoj Jul 7, 2023
3168078
test shape legends and groups in multiple legends
archmoj Jul 7, 2023
6343338
add name to newshape and improve descriptions
archmoj Jul 17, 2023
7bf5029
coerce newshape.name
archmoj Jul 17, 2023
948fd02
add name to newshapes when creating a new one
archmoj Jul 18, 2023
e5a600d
Update src/components/shapes/draw_newshape/attributes.js
archmoj Jul 18, 2023
5b02b62
more name appears fixes and update the schema
archmoj Jul 18, 2023
b35add8
fix shape.name updates via editing legends
archmoj Jul 18, 2023
6111aba
fix double click shape legends
archmoj Jul 19, 2023
5c0168c
simplify handling shape legends in click
archmoj Jul 20, 2023
15986b8
jasmine tests for editable shape legends
archmoj Jul 21, 2023
759dbb4
use update instead of restyle & relayout when updating shape legends
archmoj Jul 24, 2023
9123425
Merge remote-tracking branch 'origin/master' into shape-legends
archmoj Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/shapes/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ module.exports = templatedArray('shape', {
valType: 'string',
dflt: '',
editType: 'arraydraw',
description: 'Sets the text to display with shape.'
description: [
'Sets the text to display with shape.',
'It is also used for legend item if `name` is not provided.'
].join(' ')
},
texttemplate: shapeTexttemplateAttrs({}, {keys: Object.keys(shapeLabelTexttemplateVars)}),
font: fontAttrs({
Expand Down
13 changes: 12 additions & 1 deletion src/components/shapes/draw_newshape/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,22 @@ module.exports = overrideAll({
'*vertical* allows vertical extend.'
].join(' ')
},

name: extendFlat({}, basePlotAttributes.name, {
description: [
'Sets new shape name.',
'The name appear as the legend item.'
archmoj marked this conversation as resolved.
Show resolved Hide resolved
].join(' ')
}),

label: {
text: {
valType: 'string',
dflt: '',
description: 'Sets the text to display with the new shape.'
description: [
'Sets the text to display with the new shape.',
'It is also used for legend item if `name` is not provided.'
].join(' ')
},
texttemplate: shapeTexttemplateAttrs({newshape: true}, {keys: Object.keys(shapeLabelTexttemplateVars)}),
font: fontAttrs({
Expand Down
9 changes: 7 additions & 2 deletions test/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3650,7 +3650,7 @@
},
"role": "object",
"text": {
"description": "Sets the text to display with the new shape.",
"description": "Sets the text to display with the new shape. It is also used for legend item if `name` is not provided.",
"dflt": "",
"editType": "none",
"valType": "string"
Expand Down Expand Up @@ -3804,6 +3804,11 @@
"valType": "number"
}
},
"name": {
"description": "Sets new shape name. The name appear as the legend item.",
"editType": "none",
"valType": "string"
},
"opacity": {
"description": "Sets the opacity of new shapes.",
"dflt": 1,
Expand Down Expand Up @@ -7379,7 +7384,7 @@
},
"role": "object",
"text": {
"description": "Sets the text to display with shape.",
"description": "Sets the text to display with shape. It is also used for legend item if `name` is not provided.",
"dflt": "",
"editType": "arraydraw",
"valType": "string"
Expand Down