René's URL Explorer Experiment


Title: Scattergl Hover:closest and Click only active with first-plotted trace · Issue #2079 · plotly/plotly.py · GitHub

Open Graph Title: Scattergl Hover:closest and Click only active with first-plotted trace · Issue #2079 · plotly/plotly.py

X Title: Scattergl Hover:closest and Click only active with first-plotted trace · Issue #2079 · plotly/plotly.py

Description: EDIT Problem: Scattergl hover and click functionalities are only available for the first-plotted trace if one has multiple traces but does not matter when using Scatter. /EDIT I am using plotly 4.4.1 and was trying out the network demo o...

Open Graph Description: EDIT Problem: Scattergl hover and click functionalities are only available for the first-plotted trace if one has multiple traces but does not matter when using Scatter. /EDIT I am using plotly 4.4...

X Description: EDIT Problem: Scattergl hover and click functionalities are only available for the first-plotted trace if one has multiple traces but does not matter when using Scatter. /EDIT I am using plotly 4.4...

Opengraph URL: https://github.com/plotly/plotly.py/issues/2079

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Scattergl Hover:closest and Click only active with first-plotted trace","articleBody":"**EDIT** \r\nProblem: \r\n`Scattergl` hover and click functionalities are only available for the first-plotted trace if one has multiple traces but does not matter when using `Scatter`. \r\n**/EDIT**\r\n\r\nI am using plotly 4.4.1 and was trying out the [network demo](https://plot.ly/python/network-graphs/) on the plotly website. Since I have lots of nodes and edges in my graph, I tried using `Scattergl` instead.\r\n\r\nThis works and speeds up the plotting but disables the tool tips on hover on `hovermode=\"closest\"`. The hover does however still find the points, which we can see when we press \"Toggle Spike Lines\", which snap onto the point our cursor is closest to. \r\n\r\nClicking on the \"compare data on hover\" button let's tool tips appear but this is a very erratic experience when we have a lot of points close to each other.\r\n\r\n**EDIT: I have produced a smaller code example in the next comment on this thread.**\r\n\r\nNot sure if this was addressed in https://github.com/plotly/plotly.js/pull/4323 which should be part of my version (4.4.1).\r\nBelow is the [network demo](https://plot.ly/python/network-graphs/) with `Scatter` substituted for `Scattergl`, which can reproduce my issue:\r\n```\r\nimport plotly.graph_objects as go\r\n\r\nimport networkx as nx\r\n\r\nG = nx.random_geometric_graph(200, 0.125)\r\nedge_x = []\r\nedge_y = []\r\nfor edge in G.edges():\r\n    x0, y0 = G.nodes[edge[0]]['pos']\r\n    x1, y1 = G.nodes[edge[1]]['pos']\r\n    edge_x.append(x0)\r\n    edge_x.append(x1)\r\n    edge_x.append(None)\r\n    edge_y.append(y0)\r\n    edge_y.append(y1)\r\n    edge_y.append(None)\r\n\r\nedge_trace = go.Scattergl(\r\n    x=edge_x, y=edge_y,\r\n    line=dict(width=0.5, color='#888'),\r\n    hoverinfo='none',\r\n    mode='lines')\r\n\r\nnode_x = []\r\nnode_y = []\r\nfor node in G.nodes():\r\n    x, y = G.nodes[node]['pos']\r\n    node_x.append(x)\r\n    node_y.append(y)\r\n\r\nnode_trace = go.Scattergl(\r\n    x=node_x, y=node_y,\r\n    mode='markers',\r\n    hoverinfo='text',\r\n    marker=dict(\r\n        showscale=True,\r\n        # colorscale options\r\n        #'Greys' | 'YlGnBu' | 'Greens' | 'YlOrRd' | 'Bluered' | 'RdBu' |\r\n        #'Reds' | 'Blues' | 'Picnic' | 'Rainbow' | 'Portland' | 'Jet' |\r\n        #'Hot' | 'Blackbody' | 'Earth' | 'Electric' | 'Viridis' |\r\n        colorscale='YlGnBu',\r\n        reversescale=True,\r\n        color=[],\r\n        size=10,\r\n        colorbar=dict(\r\n            thickness=15,\r\n            title='Node Connections',\r\n            xanchor='left',\r\n            titleside='right'\r\n        ),\r\n        line_width=2))\r\nnode_adjacencies = []\r\nnode_text = []\r\nfor node, adjacencies in enumerate(G.adjacency()):\r\n    node_adjacencies.append(len(adjacencies[1]))\r\n    node_text.append('# of connections: '+str(len(adjacencies[1])))\r\n\r\nnode_trace.marker.color = node_adjacencies\r\nnode_trace.text = node_text\r\nfig = go.Figure(data=[edge_trace, node_trace],\r\n             layout=go.Layout(\r\n                title='\u003cbr>Network graph made with Python',\r\n                titlefont_size=16,\r\n                showlegend=False,\r\n                hovermode='closest',\r\n                margin=dict(b=20,l=5,r=5,t=40),\r\n                annotations=[ dict(\r\n                    text=\"Python code: \u003ca href='https://plot.ly/ipython-notebooks/network-graphs/'> https://plot.ly/ipython-notebooks/network-graphs/\u003c/a>\",\r\n                    showarrow=False,\r\n                    xref=\"paper\", yref=\"paper\",\r\n                    x=0.005, y=-0.002 ) ],\r\n                xaxis=dict(showgrid=False, zeroline=False, showticklabels=False),\r\n                yaxis=dict(showgrid=False, zeroline=False, showticklabels=False))\r\n                )\r\nfig.show()\r\n```\r\n","author":{"url":"https://github.com/tobsecret","@type":"Person","name":"tobsecret"},"datePublished":"2020-01-15T21:35:11Z","url":"https://github.com/plotly/plotly.py/issues/2079"}

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:eebb6b99-9e78-e886-f858-26f76e29832f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB5B2:299992:A83972:DEB69A:6B01BB51
html-safe-nonce83b166a1870272d7e4c88188cfc3f50c169f82653ba9f6990efaa99fd444af1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUIyOjI5OTk5MjpBODM5NzI6REVCNjlBOjZCMDFCQjUxIiwidmlzaXRvcl9pZCI6IjUwODY3MDgwNzYwMTUzNjkwNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac54bf305e89b36b9389426595c5012682b75cce48bbf43b9b481952274eab9c3c
hovercard-subject-tagissue:550442547
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.py/2079/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a319dcd4bcb7f0eb19b6545dc4384b3a93e37a1789a3ee2e69f9a1a9ad87a584/plotly/plotly.py/issues/2079
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a319dcd4bcb7f0eb19b6545dc4384b3a93e37a1789a3ee2e69f9a1a9ad87a584/plotly/plotly.py/issues/2079
og:image:altEDIT Problem: Scattergl hover and click functionalities are only available for the first-plotted trace if one has multiple traces but does not matter when using Scatter. /EDIT I am using plotly 4.4...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametobsecret
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id14579099
octolytics-dimension-repository_nwoplotly/plotly.py
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14579099
octolytics-dimension-repository_network_root_nwoplotly/plotly.py
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.py/issues/2079#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.py%2Fissues%2F2079
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.py%2Fissues%2F2079
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.py
Reloadhttps://github.com/plotly/plotly.py/issues/2079
Reloadhttps://github.com/plotly/plotly.py/issues/2079
Reloadhttps://github.com/plotly/plotly.py/issues/2079
plotlyhttps://github.com/plotly
plotly.pyhttps://github.com/plotly/plotly.py
Codehttps://github.com/plotly/plotly.py
Issues650 (650)https://github.com/plotly/plotly.py/issues
Pull requests83 (83)https://github.com/plotly/plotly.py/pulls
Actionshttps://github.com/plotly/plotly.py/actions
Security and qualityhttps://github.com/plotly/plotly.py/security
Insightshttps://github.com/plotly/plotly.py/insights
https://github.com/plotly/plotly.py
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/2079
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/2079
Scattergl Hover:closest and Click only active with first-plotted tracehttps://github.com/plotly/plotly.py/issues/2079#top
P3backloghttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22P3%22
bugsomething brokenhttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/tobsecret
tobsecrethttps://github.com/tobsecret
on Jan 15, 2020https://github.com/plotly/plotly.py/issues/2079#issue-550442547
network demohttps://plot.ly/python/network-graphs/
plotly/plotly.js#4323https://github.com/plotly/plotly.js/pull/4323
network demohttps://plot.ly/python/network-graphs/
https://github.com/tobsecret
tobsecrethttps://github.com/tobsecret
on Jan 17, 2020https://github.com/plotly/plotly.py/issues/2079#issuecomment-575797020
https://user-images.githubusercontent.com/10303623/72646658-a52d7300-3944-11ea-92fe-3a3db183bce0.PNG
tobsecrethttps://github.com/tobsecret
on Jan 17, 2020https://github.com/plotly/plotly.py/issues/2079#event-2959547250
https://github.com/emmanuelle
emmanuellehttps://github.com/emmanuelle
on Jan 21, 2020https://github.com/plotly/plotly.py/issues/2079#issuecomment-576781917
@tobsecrethttps://github.com/tobsecret
https://github.com/tobsecret
tobsecrethttps://github.com/tobsecret
on Jan 21, 2020https://github.com/plotly/plotly.py/issues/2079#issuecomment-576836766
@emmanuellehttps://github.com/emmanuelle
examplehttps://github.com/plotly/plotly.py/issues/2079#issuecomment-575797020
https://github.com/StefPetro
StefPetrohttps://github.com/StefPetro
on Nov 25, 2020https://github.com/plotly/plotly.py/issues/2079#issuecomment-733627955
https://github.com/tobsecret
tobsecrethttps://github.com/tobsecret
on Nov 25, 2020https://github.com/plotly/plotly.py/issues/2079#issuecomment-733800427
gvwilsonhttps://github.com/gvwilson
on Jun 18, 2024https://github.com/plotly/plotly.py/issues/2079#event-13203622267
gvwilsonhttps://github.com/gvwilson
on Aug 2, 2024https://github.com/plotly/plotly.py/issues/2079#event-13740701858
gvwilsonhttps://github.com/gvwilson
P3backloghttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22P3%22
bugsomething brokenhttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22bug%22
on Aug 12, 2024https://github.com/plotly/plotly.py/issues/2079#event-13849400707
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.py/issues/2079
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.py/issues/2079
P3backloghttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22P3%22
bugsomething brokenhttps://github.com/plotly/plotly.py/issues?q=state%3Aopen%20label%3A%22bug%22
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.