plotly.js: improve plotly modeBarButtonsToAdd type#63295
plotly.js: improve plotly modeBarButtonsToAdd type#63295typescript-bot merged 2 commits intoDefinitelyTyped:masterfrom andoks:topic/improve-plotly-modeBarButtonsToAdd-type
Conversation
|
@andoks Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through. This is a live comment which I will keep updated. 1 package in this PR
Code ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. You can test the changes of this PR in the Playground. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 63295,
"author": "andoks",
"headCommitOid": "332f155d7c387e40db65ea19ef2e459e3b7596fa",
"mergeBaseOid": "b3eaabfaf96b678c7312addb57db280009dc6002",
"lastPushDate": "2022-11-21T21:46:27.000Z",
"lastActivityDate": "2022-11-22T19:58:18.000Z",
"mergeOfferDate": "2022-11-22T19:04:06.000Z",
"mergeRequestDate": "2022-11-22T19:58:18.000Z",
"mergeRequestUser": "andoks",
"hasMergeConflict": false,
"isFirstContribution": true,
"tooManyFiles": false,
"hugeChange": false,
"popularityLevel": "Popular",
"pkgInfo": [
{
"name": "plotly.js",
"kind": "edit",
"files": [
{
"path": "types/plotly.js/index.d.ts",
"kind": "definition"
},
{
"path": "types/plotly.js/test/index-tests.ts",
"kind": "test"
}
],
"owners": [
"chrisgervang",
"martinduparc",
"frederikaalund",
"taoqf",
"Dadstart",
"szechyjs",
"soorajpudiyadath",
"jonfreedman",
"meganrm",
"milesjos",
"skippercool",
"mtadams007",
"marnett-git",
"peterblazejewicz",
"brammitch",
"blizzardjessica",
"olegshilov",
"PabloGracia",
"jvgogh"
],
"addedOwners": [],
"deletedOwners": [],
"popularityLevel": "Popular"
}
],
"reviews": [
{
"type": "approved",
"reviewer": "peterblazejewicz",
"date": "2022-11-22T19:03:22.000Z",
"isMaintainer": true
}
],
"mainBotCommentID": 1318766005,
"ciResult": "pass"
} |
|
🔔 @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @soorajpudiyadath @jonfreedman @meganrm @milesjos @SkipperCool @mtadams007 @marnett-git @peterblazejewicz @brammitch @blizzardjessica @olegshilov @PabloGracia @jvgogh — please review this PR in the next few days. Be sure to explicitly select |
|
Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files. plotly.js (unpkg)was missing the following properties:
|
|
does it make sense to name those simply |
|
@peterblazejewicz: thanks for taking the time to check the PR! I would prefer to rename ModeBarDefaultButtons to ModeBarBuiltinButtons - ModeBarButton to ModeBarCustomButton - and then ModeBarButtonAny to ModeBarButton. However this will break backwards-compatibility. I personally would prefer not to call ModeBarButtonAny ModeBarButtons, since it describes a singular object (either a typed string representing a builtin-button, or a custom-button). I am totally on board with not having "Any" in the name though, but that was what I came up with in the moment. However I do not have particular strong feelings about this, so if renaming it to ModeBarButtons is preferred by you as upstream maintainer, I can do that no problem. |
peterblazejewicz
left a comment
There was a problem hiding this comment.
@andoks thanks!
LGTM!
…BarButtonsToAdd Add the missing hover-related default-button strings as supported in [plotly.js 2.12][]. Of particular importance is perhaps the v1hovermode which restores the default modebar buttons from plotly v1 (see [PR: Hide hover and spike modebar buttons... #5654][]). Also add a test for using the values in modeBarButtonsToAdd [plotly.js 2.12]: <https://github.com/plotly/plotly.js/blob/v2.12.0/src/components/modebar/manage.js#L235> [PR: Hide hover and spike modebar buttons... #5654]: <plotly/plotly.js#5654>
Also test that passing both predefined button strings and custom button structs works
|
@peterblazejewicz Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
Ready to merge |
|
🛂 Hi @andoks, I can't accept a pull request until all of the checks in the "Status" section of this comment are green. I will let you know once that happens. Thanks, and happy typing! |
|
Ready to merge |
|
@peterblazejewicz: I can not see the updated version at https://www.npmjs.com/package/@types/plotly.js?activeTab=versions. Do you know when a new release of @types/plotly.js will be released so that I may use the updated version? I also created a discussion regarding the possibly broken azure release pipelines here: #63362 - in case that is what's causing the release to not being created and pushed. EDIT: this change is now included in version 2.12.9 (https://www.npmjs.com/package/@types/plotly.js/v/2.12.9). I probably misinterpreted next day with regards to timezones or something. |
Please fill in this template.
npm test <package to test>.If changing an existing definition: