-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 support for numeric font weight
#6990
Changes from 8 commits
37dee48
3212866
448eb80
3a3f458
15b25a5
be24a14
d8424a3
353efc4
abb3fc8
8266a6d
46e6b27
3e4942a
72044b5
4d52885
b92ef23
b125396
54005b9
09f4dd3
f67b40c
99162e5
990fa8d
f3c0356
a5cc7f8
63824c1
190aef1
091e7d3
82de3ff
59779f3
f6fcbd7
10f477f
82863fd
bff00ac
48d057f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add support for numeric text font `weight` [[#6990](https://github.com/plotly/plotly.js/pull/6990)] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this mock, maybe use a font that has more available weights, to test that they work properly in WebGL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I was interested to test it with the default font as that's what most users use at this moment. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"hovertemplate": "Difficult -0.123456789 | %{text}", | ||
"texttemplate": "Difficult -0.123456789 | %{text}", | ||
"text": [ | ||
"1 Minimum", | ||
"100 Thin (Hairline)", | ||
"200 Extra Light (Ultra Light)", | ||
"300 Light", | ||
"400 Normal (Regular)", | ||
"500 Medium", | ||
"600 Semi Bold (Demi Bold)", | ||
"700 Bold", | ||
"800 Extra Bold (Ultra Bold)", | ||
"900 Black (Heavy)", | ||
"950 Extra Black (Ultra Black)", | ||
"1000 Maximum" | ||
], | ||
"textposition": "right", | ||
"textfont": { | ||
"size": 12, | ||
"weight": [ | ||
1, | ||
100, | ||
200, | ||
300, | ||
400, | ||
500, | ||
600, | ||
700, | ||
800, | ||
900, | ||
950, | ||
1000 | ||
] | ||
}, | ||
"x": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
"y": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], | ||
"type": "bar", | ||
"orientation": "h" | ||
} | ||
], | ||
"layout": { | ||
"showlegend": false, | ||
"margin": { | ||
"l": 0, | ||
"r": 0, | ||
"t": 0, | ||
"b": 0 | ||
}, | ||
"xaxis": { | ||
"range": [1.1, -0.1], | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"yaxis": { | ||
"range": [11.5, -0.5], | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"width": 400, | ||
"height": 600, | ||
"hovermode": "closest" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"hovertemplate": "Difficult -0.123456789 | %{text}", | ||
"texttemplate": "Difficult -0.123456789 | %{text}", | ||
"mode": "text", | ||
"text": [ | ||
"1 Minimum", | ||
"100 Thin (Hairline)", | ||
"200 Extra Light (Ultra Light)", | ||
"300 Light", | ||
"400 Normal (Regular)", | ||
"500 Medium", | ||
"600 Semi Bold (Demi Bold)", | ||
"700 Bold", | ||
"800 Extra Bold (Ultra Bold)", | ||
"900 Black (Heavy)", | ||
"950 Extra Black (Ultra Black)", | ||
"1000 Maximum" | ||
], | ||
"textfont": { | ||
"family": "Inter", | ||
"size": 16, | ||
"weight": [ | ||
1, | ||
100, | ||
200, | ||
300, | ||
400, | ||
500, | ||
600, | ||
700, | ||
800, | ||
900, | ||
950, | ||
1000 | ||
] | ||
}, | ||
"x": [0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0], | ||
"y": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | ||
} | ||
], | ||
"layout": { | ||
"showlegend": false, | ||
"margin": { | ||
"l": 0, | ||
"r": 0, | ||
"t": 0, | ||
"b": 0 | ||
}, | ||
"xaxis": { | ||
"range": [-1, 1], | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"yaxis": { | ||
"range": [11.5, -0.5], | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"width": 400, | ||
"height": 600, | ||
"hovermode": "closest" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{ | ||
"data": [ | ||
{ | ||
"type": "scatter3d", | ||
"hovertemplate": "Difficult -0.123456789 | %{text}", | ||
"texttemplate": "Difficult -0.123456789 | %{text}", | ||
"mode": "text", | ||
"text": [ | ||
"1 Minimum", | ||
"100 Thin (Hairline)", | ||
"200 Extra Light (Ultra Light)", | ||
"300 Light", | ||
"400 Normal (Regular)", | ||
"500 Medium", | ||
"600 Semi Bold (Demi Bold)", | ||
"700 Bold", | ||
"800 Extra Bold (Ultra Bold)", | ||
"900 Black (Heavy)", | ||
"950 Extra Black (Ultra Black)", | ||
"1000 Maximum" | ||
], | ||
"textfont": { | ||
"family": "Inter", | ||
"size": 16, | ||
"weight": [ | ||
1, | ||
100, | ||
200, | ||
300, | ||
400, | ||
500, | ||
600, | ||
700, | ||
800, | ||
900, | ||
950, | ||
1000 | ||
] | ||
}, | ||
"z": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | ||
"x": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | ||
"y": [-5.5, -4.5, -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5] | ||
} | ||
], | ||
"layout": { | ||
"showlegend": false, | ||
"margin": { | ||
"l": 0, | ||
"r": 0, | ||
"t": 0, | ||
"b": 0 | ||
}, | ||
"scene": { | ||
"xaxis": { | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"yaxis": { | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"zaxis": { | ||
"showticklabels": false, | ||
"showgrid": false, | ||
"zeroline": false | ||
}, | ||
"aspectratio": { | ||
"x": 1.5, | ||
"y": 1.5, | ||
"z": 1.5 | ||
}, | ||
"camera": { | ||
"projection": { | ||
"type": "orthographic" | ||
}, | ||
"eye": { | ||
"x": 0, | ||
"y": 0, | ||
"z": 10 | ||
}, | ||
"center": { | ||
"x": 0, | ||
"y": 0, | ||
"z": 0 | ||
}, | ||
"up": { | ||
"x": 0, | ||
"y": 1, | ||
"z": 0 | ||
} | ||
} | ||
}, | ||
"width": 400, | ||
"height": 400, | ||
"hovermode": "closest" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@archmoj Is this adding a new functionality to
coerce
, where numeric (or other) properties can also be configured to accept a list of 'extra' values?That's pretty cool -- is there anywhere we should document that internally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
Yes that's true.
We have other types that support the
extras
option so I think it's clear internally.But on plotly.py we need to see if this changes would be reflected properly by codegen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
Makes me think, it would be awesome if we could build checking the Plotly.py codegen into the CI process. It would have to produce some kind of output that's easy to verify. It could run only if the
schema.json
has changed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps add a line in the docstring here explaining
extras
for integers (like the explanation here forflaglist
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For flag lists combination mean something. That's why it is commented.