Skip to content
New issue

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

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

Already on GitHub? # to your account

Plotly - add missing property uid #66058

Merged
merged 7 commits into from
Jul 13, 2023

Conversation

mrtnbrst
Copy link
Contributor

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change.

I only formatted the code, again a file changed, no actual change to the code was made

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>

https://github.com/plotly/plotly.js/blob/ab5e16afc34fa4f22efffef129f811381580e0fe/src/plots/attributes.js#L109 -> uid
Mapbox has uid: https://github.com/plotly/plotly.js/blob/96c28159c06a3af3fe551175db89599894efbf82/src/plots/mapbox/mapbox.js#L35

https://plotly.com/python-api-reference/generated/plotly.graph_objects.Figure.html

uid – Assign an id to this trace, Use this to provide object constancy between traces during animations and transitions.

Traces have uid:
https://github.com/plotly/plotly.js/blob/19030614649428a0341d28402178bdd32fc75357/src/plot_api/plot_api.js#L679

https://github.com/plotly/plotly.js/blob/ab5e16afc34fa4f22efffef129f811381580e0fe/src/plots/attributes.js#L224
Description of uirevision (already in type definition) using the uid:

'Trace changes are tracked by uid, which only falls back on trace',
'index if no uid is provided. So if your app can add/remove traces',
'before the end of the data array, such that the same trace has a',
'different index, you can still preserve user-driven changes if you',
'give each trace a uid that stays with it as it moves.'

I added to uid to the places where the uirevision was already there / where I found hints about the uid being available.

I only manually tested the uid changes for my personal use case, a scatter plot (relevant type ScatterData = PlotData), I am not entirely sure about all the changes I did.

@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 13, 2023

@mrtnbrst Thank you for submitting this PR!

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": 66058,
  "author": "mrtnbrst",
  "headCommitOid": "936d697f802da7a6749c8815d08be8332646b354",
  "mergeBaseOid": "e42746838dabadb4aa0542017f178a3c118f4e18",
  "lastPushDate": "2023-07-13T17:17:35.000Z",
  "lastActivityDate": "2023-07-13T19:10:28.000Z",
  "mergeOfferDate": "2023-07-13T19:09:41.000Z",
  "mergeRequestDate": "2023-07-13T19:10:28.000Z",
  "mergeRequestUser": "mrtnbrst",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "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/core-tests.ts",
          "kind": "test"
        },
        {
          "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",
        "jpabdou"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "brammitch",
      "date": "2023-07-13T19:08:54.000Z",
      "isMaintainer": false
    }
  ],
  "mainBotCommentID": 1634618959,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Edits Owners This PR adds or removes owners Popular package This PR affects a popular package (as counted by NPM download counts). labels Jul 13, 2023
@typescript-bot
Copy link
Contributor

🔔 @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @soorajpudiyadath @jonfreedman @meganrm @milesjos @SkipperCool @mtadams007 @marnett-git @peterblazejewicz @brammitch @blizzardjessica @olegshilov @PabloGracia @jvgogh @jpabdou — 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.

@mrtnbrst
Copy link
Contributor Author

I guess I shouldn't be an owner, I misunderstood the meaning of it.

@DangerBotOSS
Copy link

DangerBotOSS commented Jul 13, 2023

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. Fx
  3. Snapshot
  4. PlotSchema

Generated by 🚫 dangerJS against 936d697

Copy link
Contributor

@brammitch brammitch left a comment

Choose a reason for hiding this comment

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

UID changes look good to me.

types/plotly.js/index.d.ts Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting-only changes look good to me. Matches what I see on my local copy.

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 13, 2023
@typescript-bot typescript-bot removed Self Merge This PR can now be self-merged by the PR author or an owner Owner Approved A listed owner of this package signed off on the pull request. Edits Owners This PR adds or removes owners labels Jul 13, 2023
@typescript-bot
Copy link
Contributor

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

@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 13, 2023
@typescript-bot
Copy link
Contributor

@mrtnbrst: Everything looks good here. I am ready to merge this PR (at 936d697) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@chrisgervang, @martinduparc, @frederikaalund, @taoqf, @Dadstart, @szechyjs, @soorajpudiyadath, @jonfreedman, @meganrm, @milesjos, @SkipperCool, @mtadams007, @marnett-git, @peterblazejewicz, @brammitch, @blizzardjessica, @olegshilov, @PabloGracia, @jvgogh, @jpabdou: you can do this too.)

@mrtnbrst
Copy link
Contributor Author

Ready to merge

@typescript-bot typescript-bot merged commit 62e7140 into DefinitelyTyped:master Jul 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Owner Approved A listed owner of this package signed off on the pull request. 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