René's URL Explorer Experiment


Title: Bindings · Issue #1002 · plotly/plotly.js · GitHub

Open Graph Title: Bindings · Issue #1002 · plotly/plotly.js

X Title: Bindings · Issue #1002 · plotly/plotly.js

Description: As controls get more capable in plotly, two-way binding becomes necessary. That is, a slider can change the frame, but the slider should also reflect the current frame when something else (e.g. a play button) changes it. This could also ...

Open Graph Description: As controls get more capable in plotly, two-way binding becomes necessary. That is, a slider can change the frame, but the slider should also reflect the current frame when something else (e.g. a p...

X Description: As controls get more capable in plotly, two-way binding becomes necessary. That is, a slider can change the frame, but the slider should also reflect the current frame when something else (e.g. a p...

Opengraph URL: https://github.com/plotly/plotly.js/issues/1002

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bindings","articleBody":"As controls get more capable in plotly, two-way binding becomes necessary. That is, a slider can change the frame, but the slider should also reflect the current frame when something else (e.g. a play button) changes it. This could also be the case for a marker size, a size ref, or a transform parameter. My current [slider PR](https://github.com/plotly/plotly.js/pull/986) does this in sort of [an ad hoc manner](https://github.com/plotly/plotly.js/pull/986/files#diff-8e9a79b541026f6567178f4c9d990c99R81), but I really think it should be more general.\n\n**Proposal**: `bindings`\n\n**Option 1**:\n\nBindings are defined in the layout. For example: \n\n``` json\n\"layout\": {\n  \"bindings\": [{\n    \"bind\": \"layout.updatemenus[0].active\",\n    \"to\": \"data[0].marker.color\",\n    \"lookup\": {\n      \"red\": 0,\n      \"green\": 1,\n      \"blue\": 2\n    }\n  }]\n}\n```\n\nIn this example, `bind` is the data that gets changed, `to` is the item that's observed for changes, and `lookup` is an optional translation table that maps one to the other. Whenever a plotly event is emitted or when a relayout/restyle/update occurs, we quickly look through the bindings to see what's changed (which shouldn't be expensive enough that it's a problem). If an item has changed, that item is written to the state of the plot. A `plotly_bindingchange` event is emitted. _All_ components (that's the best I can do right now) must then look through their data to see if anything has changed and update accordingly.\n\n_Pros_:\n- Bindings link two parts of the plotly state, which accurately represents what's actually happening\n\n_Cons_:\n- Updates take just a bit of thought and bookkeeping to do efficiently since this isn't react\n- requires a separate specification of bindings in addition to just the slider\n- refers to other parts of the plotly json by integer index within the plotly json, which seems probably okay but 10% fragile\n\n**Option 2**:\n\nBindings are defined in the component that needs them, e.g. a slider. The slider has:\n\n``` json\n\"bindto\": \"data[0].marker.color\"\n```\n\nMost of the logic is the same. (I've omitted the lookup table since, though it could be added, we should probably go to great lengths to generally avoid _needing_.) When a component binds to a variable, we register it as needing a lookup. We scan through those liberally since it's fast, and when one changes, we emit an event. This case is a little simpler since we can emit `plotly_bindingchange` with data `{binding: 'data[0].marker.color', value: 'red'}`. The component sees its binding has changed and updates accordingly.\n\n_Pros_:\n- Requires less typing\n- Collocates binding with the thing that uses the binding\n- Avoids extra reference to `updatemenus[0].active`\n- The update pattern is maybe a bit more straightforward since the component directly knows about the binding.\n\n_Cons_:\n- Less general since it specifies a way of hooking up a component to a json item instead of hooking up a json item to a json item\n\ncc: @etpinard @chriddyp @alexcjohnson \n","author":{"url":"https://github.com/rreusser","@type":"Person","name":"rreusser"},"datePublished":"2016-10-04T14:57:10Z","url":"https://github.com/plotly/plotly.js/issues/1002"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3d982ac0-987c-93ff-1c27-3046de4a5fbc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB96E:136CDA:10AC623:161C2F1:6B01E1E7
html-safe-nonced144a1c796f07ec50a57e0d259c959c92c6944f3648bddd473de8d470a245083
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTZFOjEzNkNEQToxMEFDNjIzOjE2MUMyRjE6NkIwMUUxRTciLCJ2aXNpdG9yX2lkIjoiODYwNDIyNzMxNzI0MzQzNzU0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc976da20edddf6cf84b992819811594eb871a0dccecf8c105e0c0fce24e145d8
hovercard-subject-tagissue:180917144
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/1002/issue_layout
twitter:imagehttps://opengraph.githubassets.com/69c3c56f849bacec31acae0d3f8578e9b0fb1e022b0eb706a28960fea57d8744/plotly/plotly.js/issues/1002
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/69c3c56f849bacec31acae0d3f8578e9b0fb1e022b0eb706a28960fea57d8744/plotly/plotly.js/issues/1002
og:image:altAs controls get more capable in plotly, two-way binding becomes necessary. That is, a slider can change the frame, but the slider should also reflect the current frame when something else (e.g. a p...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerreusser
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id45646037
octolytics-dimension-repository_nwoplotly/plotly.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id45646037
octolytics-dimension-repository_network_root_nwoplotly/plotly.js
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/plotly/plotly.js/issues/1002#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F1002
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.js%2Fissues%2F1002
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=plotly%2Fplotly.js
Reloadhttps://github.com/plotly/plotly.js/issues/1002
Reloadhttps://github.com/plotly/plotly.js/issues/1002
Reloadhttps://github.com/plotly/plotly.js/issues/1002
plotlyhttps://github.com/plotly
plotly.jshttps://github.com/plotly/plotly.js
Codehttps://github.com/plotly/plotly.js
Issues726 (726)https://github.com/plotly/plotly.js/issues
Pull requests84 (84)https://github.com/plotly/plotly.js/pulls
Actionshttps://github.com/plotly/plotly.js/actions
Security and qualityhttps://github.com/plotly/plotly.js/security
Insightshttps://github.com/plotly/plotly.js/insights
https://github.com/plotly/plotly.js
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/1002
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/1002
Bindingshttps://github.com/plotly/plotly.js/issues/1002#top
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
v1.19.0https://github.com/plotly/plotly.js/milestone/12
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issue-180917144
slider PRhttps://github.com/plotly/plotly.js/pull/986
an ad hoc mannerhttps://github.com/plotly/plotly.js/pull/986/files#diff-8e9a79b541026f6567178f4c9d990c99R81
@etpinardhttps://github.com/etpinard
@chriddyphttps://github.com/chriddyp
@alexcjohnsonhttps://github.com/alexcjohnson
rreusserhttps://github.com/rreusser
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
status: discussion neededhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22status%3A%20discussion%20needed%22
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#event-811881612
https://github.com/etpinard
etpinardhttps://github.com/etpinard
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251417312
@chriddyphttps://github.com/chriddyp
https://github.com/etpinard
etpinardhttps://github.com/etpinard
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251418848
@alexcjohnsonhttps://github.com/alexcjohnson
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251425708
@etpinardhttps://github.com/etpinard
https://github.com/alexcjohnson
alexcjohnsonhttps://github.com/alexcjohnson
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251426326
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251429081
@alexcjohnsonhttps://github.com/alexcjohnson
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251429502
https://github.com/alexcjohnson
alexcjohnsonhttps://github.com/alexcjohnson
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251431947
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251432547
@alexcjohnsonhttps://github.com/alexcjohnson
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251440437
https://github.com/alexcjohnson
alexcjohnsonhttps://github.com/alexcjohnson
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251443451
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 4, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-251445966
https://github.com/rreusser
rreusserhttps://github.com/rreusser
on Oct 11, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-252928976
@alexcjohnsonhttps://github.com/alexcjohnson
@etpinardhttps://github.com/etpinard
#1016https://github.com/plotly/plotly.js/pull/1016
etpinardhttps://github.com/etpinard
v1.19.0https://github.com/plotly/plotly.js/milestone/12
on Oct 13, 2016https://github.com/plotly/plotly.js/issues/1002#event-822599907
https://github.com/etpinard
etpinardhttps://github.com/etpinard
on Oct 25, 2016https://github.com/plotly/plotly.js/issues/1002#issuecomment-256171455
#1016https://github.com/plotly/plotly.js/pull/1016
etpinardhttps://github.com/etpinard
completedhttps://github.com/plotly/plotly.js/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 25, 2016https://github.com/plotly/plotly.js/issues/1002#event-836123196
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.js/issues/1002
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.js/issues/1002
featuresomething newhttps://github.com/plotly/plotly.js/issues?q=state%3Aopen%20label%3A%22feature%22
v1.19.0https://github.com/plotly/plotly.js/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.