') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Add Mucho Marker example to docs by etpinard · Pull Request #16 · plotly/documentation · GitHub
Skip to content

Add Mucho Marker example to docs - #16

Closed
etpinard wants to merge 2 commits into
masterfrom
mucho-markers
Closed

Add Mucho Marker example to docs#16
etpinard wants to merge 2 commits into
masterfrom
mucho-markers

Conversation

@etpinard

Copy link
Copy Markdown
Contributor

@theengineear

Copy link
Copy Markdown
Contributor

Awesome! It's clear to me how I would add dots or not fill markers, but maybe you could just do a few examples of that on the right? I.e., put another column at the right with a few examples of using -open-dot to make it easier for users to get that caption?

@etpinard

Copy link
Copy Markdown
ContributorAuthor

I'll see what I can do.

This layout is pretty much saturated for a 500px X 500px docs figure.

@etpinard

Copy link
Copy Markdown
ContributorAuthor

@theengineear

Copy link
Copy Markdown
Contributor

yup! that's perfect!

🐖

@etpinard

Copy link
Copy Markdown
ContributorAuthor

... I'd love to get 👍 from @alexander-daniel or @chriddyp before merging this.

@alexander-daniel

Copy link
Copy Markdown
Contributor

🍧 delicious!

@chriddyp

Copy link
Copy Markdown
Member

is the marker number the only way to do this? if you can also supply a string, still, then I think we should include it.

@etpinard

Copy link
Copy Markdown
ContributorAuthor

@chriddyp correct. The corresponding marker symbol strings appear on hover.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it confusing that this will be peoples first introduction to setting arrays for attributes inside a trace? previously, we introduced this concept in the bubble charts section. people might think that to set a trace to square symbols , you have to set a symbol array, and set every single element in that array to "square". .. you know what I mean?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

another solution might be to include an example with customized per -trace properties, e.g. color, symbol, and then include a "prepend" or "append" (cc @EnginEAR, @alex-vados) note that has a link to this example, "to see all possible marker types"

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Good point.

Would you recommend making 45 traces instead?

Or putting https://plot.ly/~etpinard/435/500/500/ is bubble-charts/ ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we might also want to include an example like (or identical) to the bubble charts example in "line-and-scatter" section, to show people how to set properties as an array inside a trace

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

or just a few traces (5) and include a prepend section with a link to the reference section and your example of every single symbol type

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@alex-vados - could you wire in the prepend and append section to the docs template?

@etpinard

Copy link
Copy Markdown
ContributorAuthor

Hmm. Ok I'll wait for a consensus before merging this.

@etpinard

Copy link
Copy Markdown
ContributorAuthor

Or, to relate to #18, maybe we should have an Advanced styling section separated from Chart types with pages for color, color scales, symbols, etc ...

@theengineear

Copy link
Copy Markdown
Contributor

I think this should probably get linked elsewhere as it applies to both bubbles and line+scatter. for my 2 cents.

@theengineear

Copy link
Copy Markdown
Contributor

@etpinard, is this PR still relevant?

@etpinard

Copy link
Copy Markdown
ContributorAuthor

@theengineear Relevant for sure. I still think we should have this example in our docs.

That said,

  • I'll start over on a new branch once you're done modifying run.py
  • In my mind, this example should be in a different section (e.g. Advanced styling) separate from Chart types together with pages for color, color scales, symbols, etc ...

Thoughts?

@theengineear

Copy link
Copy Markdown
Contributor

Gotcha, I thought it might have gotten into documentation through a different branch. Yeah, this should definitely be in there. Perhaps a name like "Plot styling" might attract better searches though? Either way, yeah, I could foresee a number of examples getting filed there.

@etpinard

Copy link
Copy Markdown
ContributorAuthor

I like the sound of Plot styling.

@alexander-daniel@chriddyp Thoughts?

@etpinard

Copy link
Copy Markdown
ContributorAuthor

All the colorscale plots on https://plot.ly/python/heatmaps/ would better fit under Plot styling / Color scales in my mind.

@chriddyp

Copy link
Copy Markdown
Member

Plot styling! I think that's a good idea. Moving to another repo!

@chriddyp

Copy link
Copy Markdown
Member

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@etpinard@theengineear@alexander-daniel@chriddyp