Skip to content

plotly.js: improve plotly modeBarButtonsToAdd type#63295

Merged
typescript-bot merged 2 commits intoDefinitelyTyped:masterfrom
andoks:topic/improve-plotly-modeBarButtonsToAdd-type
Nov 22, 2022
Merged

plotly.js: improve plotly modeBarButtonsToAdd type#63295
typescript-bot merged 2 commits intoDefinitelyTyped:masterfrom
andoks:topic/improve-plotly-modeBarButtonsToAdd-type

Conversation

@andoks
Copy link
Copy Markdown
Contributor

@andoks andoks commented Nov 17, 2022

Please fill in this template.

If changing an existing definition:

@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented Nov 17, 2022

@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 Reviews

Because 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

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

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"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels Nov 17, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @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 Approve or Request Changes in the GitHub UI so I know what's going on.

@DangerBotOSS
Copy link
Copy Markdown

DangerBotOSS commented Nov 17, 2022

Inspecting the JavaScript source for this package found some properties that are not in the .d.ts files.
The check for missing properties isn't always right, so take this list as advice, not a requirement.

plotly.js (unpkg)

was missing the following properties:

  1. version
  2. Icons
  3. Fx
  4. Snapshot
  5. PlotSchema

Generated by 🚫 dangerJS against 332f155

@typescript-bot typescript-bot removed the Untested Change This PR does not touch tests label Nov 17, 2022
@peterblazejewicz
Copy link
Copy Markdown
Member

does it make sense to name those simply ModeBarButtons (as per usage modeBarButtons[ToAdd],?

@andoks
Copy link
Copy Markdown
Contributor Author

andoks commented Nov 18, 2022

@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.

Copy link
Copy Markdown
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andoks thanks!
LGTM!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Nov 20, 2022
…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
@typescript-bot typescript-bot removed Self Merge This PR can now be self-merged by the PR author or an owner Maintainer Approved labels Nov 21, 2022
@typescript-bot
Copy link
Copy Markdown
Contributor

@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?

@andoks
Copy link
Copy Markdown
Contributor Author

andoks commented Nov 21, 2022

Ready to merge

@typescript-bot
Copy link
Copy Markdown
Contributor

🛂 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!

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Nov 22, 2022
@andoks
Copy link
Copy Markdown
Contributor Author

andoks commented Nov 22, 2022

Ready to merge

@typescript-bot typescript-bot merged commit 86804f3 into DefinitelyTyped:master Nov 22, 2022
@andoks
Copy link
Copy Markdown
Contributor Author

andoks commented Nov 23, 2022

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Approved Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants