Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat: Allow Normalized Theta Tooltip #8302

Closed
wants to merge 3 commits into from
Closed

Conversation

lsh
Copy link
Member

@lsh lsh commented Jul 19, 2022

Handles #8301, allows for the use of normalized percentage tooltips in theta encodings.

@lsh lsh requested review from kanitw and domoritz July 19, 2022 20:24
@kanitw
Copy link
Member

kanitw commented Jul 19, 2022

Add arc_pie_normalize_tooltip.vl.json as an example?

  • You can copy arc_pie.vl.json in examples/specs
  • Under "Circular Plots" in examples.json, add
{
        "name": "arc_pie_normalize_tooltip",
        "title": "Pie Chart with percentage_tooltip"
      },
  • Modify arc.md to include this example

@@ -67,6 +67,10 @@ You can also add a text layer to add labels to a pie chart.

**Note:** For now, [you need to add `stack: true`](https://github.com/vega/vega-lite/issues/5078) to theta to force the text to apply the same polar stacking layout.

Alternatively, setting `stack: "normalize"` allows for tooltips that display the percentage of the pie taken up by a each slice.
Copy link
Member

@kanitw kanitw Jul 21, 2022

Choose a reason for hiding this comment

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

To make this section read smoothly, I wonder if it's worth adding arc_pie_tooltip to say

{:#tooltip}
### Pie Charts with Tooltips

To add tooltip, you can set `tooltip: true` in `mark`


<span class="vl-example" data-name="arc_pie_tooltip"></span>

By default, the tooltip will show actual value of the theta field. 
Alternatively, ... 

(The tooltip anchor is for the suggested link in the stack doc)

Copy link
Member Author

Choose a reason for hiding this comment

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

Would this replace the note text on line 68 as well?

Copy link
Member

Choose a reason for hiding this comment

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

Would this replace the note text on line 68

I don't think so. That's about labeling. (That said, we can add

### Pie Charts with Labels above that part too so the doc looks like having more structure

@@ -463,7 +463,7 @@ export interface PositionBaseMixins {
*
* `stack` can be one of the following values:
* - `"zero"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).
* - `"normalize"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized). <br/>
* - `"normalize"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized)). <br/>
Copy link
Member

@kanitw kanitw Jul 21, 2022

Choose a reason for hiding this comment

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

Probably worth adding "and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)" in the parentheses for

@lsh
Copy link
Member Author

lsh commented Jul 23, 2022

Closed in favor of #8308

@lsh lsh closed this Jul 23, 2022
@lsh lsh deleted the normalize-pie-tooltip branch July 23, 2022 01:03
Sign up for free to 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.

None yet

2 participants