Skip to content

Add Filled Area Plot Visualizer Operator - #2086

Merged
shengquan-ni merged 13 commits into
masterfrom
ZheYuan-FilledAreaPlotOp-dummy
Aug 3, 2023
Merged

shengquan-ni merged 13 commits into
masterfrom
ZheYuan-FilledAreaPlotOp-dummy

Conversation

@zhey16

@zhey16 zhey16 commented Jul 25, 2023 •

Copy link
Copy Markdown
Contributor

This pull request introduces a new plot visualizer, which is Filled Are Plot.

Filled Area Plot is similar to line plot, but it fills the area under the line with colors and symbols to indicate the volumn. If there are multiple lines in a plot, the area under each line can be in different colors. In such way, the users could visualize and compare different attributes effectively.

The users need to specify the X attribute and Y attribute to build a basic plot. LineGroup attribute enables the users to separate the lines. And other two options are used to make the visualization better: coloring the plot or splitting the plot.

demo_gif

@shengquan-ni
shengquan-ni merged commit a6bb441 into master Aug 3, 2023
@shengquan-ni
shengquan-ni deleted the ZheYuan-FilledAreaPlotOp-dummy branch August 3, 2023 08:09
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
This pull request introduces a new plot visualizer, which is Filled Are
Plot.

Filled Area Plot is similar to line plot, but it fills the area under
the line with colors and symbols to indicate the volumn. If there are
multiple lines in a plot, the area under each line can be in different
colors. In such way, the users could visualize and compare different
attributes effectively.

The users need to specify the X attribute and Y attribute to build a
basic plot. LineGroup attribute enables the users to separate the lines.
And other two options are used to make the visualization better:
coloring the plot or splitting the plot.



![demo_gif](https://github.com/Texera/texera/assets/86388854/6a52c93b-62d8-4889-8a65-4d02e29df00a)

---------

Co-authored-by: MiuMiuMiue <[email protected]>
Co-authored-by: Shengquan Ni <[email protected]>
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Aug 5, 2026
…e a true 5% (apache#7149)

### What changes were proposed in this PR?

**Background (apache#7146).** The Filled Area Plot operator draws stacked area
lines, one per Line Group, which only makes sense when the groups share
an x axis. `FilledAreaPlotOpDesc.performTableCheck()` therefore emits a
Python guard that suppresses the chart when too many groups have x-value
sets disjoint from the others; the comment above it documents the rule
as "more than 5 percents of the groups have disjoint sets of x
attributes". When the guard fires, the run still completes successfully
— the operator just yields fallback HTML instead of the chart, with no
warning anywhere.

**The defect.** The guard computes the threshold as `(len(grouped) //
100) * 5`. The integer division floors first, so the tolerance is 0 for
any chart with fewer than 100 line groups, and a single disjoint group
suppresses the whole chart — e.g. a 40-group chart with 1 disjoint group
(2.5%, well under the documented 5%) was suppressed. The two expressions
only agree when the group count is an exact multiple of 100. This has
been latent since the operator was introduced in apache#2086: an `X_values`
typo in the same block kept the accumulated x-value set from ever
growing, so the guard fired constantly for an unrelated reason; apache#6894
fixed that typo, which made the tolerance arithmetic the deciding factor
for the first time.

**The change.** Swap the operand order to `(len(grouped) * 5) // 100`,
plus four behavior-neutral cleanups to the same emitted block: the
per-group `set(...unique())` is hoisted into one local (was built twice
per group), `== None` becomes `is None`, the always-true `elif not ...`
becomes `else`, and the loop `break`s once the error is set.

Below 20 groups both expressions yield 0, which is correct (1/19 = 5.3%
exceeds 5%), so the fix only changes behavior at 20+ line groups.

### Any related issues, documentation, discussions?

Fixes apache#7146. Adjacent to apache#6728 / apache#6894, which fixed an `X_values` typo
in the same block but did not touch the tolerance arithmetic.

### How was this PR tested?

`performTableCheck()` previously had no test coverage. This PR adds 10
tests to `FilledAreaPlotOpDescSpec` (TDD: written red first, green after
the fix):

- 9 assertions on the generated guard, including the tolerance
expression, a single `.unique()` per iteration, `break` placement after
the error assignment, and that user-provided column names are never
emitted verbatim.
- 1 runtime test that executes the generated Python (real pandas groupby
+ plotly rendering; only the `pytexera` import seam is stubbed) across 9
boundary datasets: 19 groups/1 disjoint still suppressed (5.3% > 5%),
20/1 and 40/2 at exactly 5.0% render, 40/1 renders (the reported bug),
40/3 suppressed, plus all-disjoint, single-group, empty-table, and
missing-column cases. It cancels (not fails) when no python with
pandas+plotly is available.

Full spec: 20/20 passing. Red-check verified: reverting only the
tolerance line makes the runtime test fail on the 40/1 and exactly-5%
cases.

Checks from [CONTRIBUTING.md] all pass locally: `sbt
WorkflowOperator/scalafmtCheck` and
`WorkflowOperator/Test/scalafmtCheck` (no violations), `sbt
"WorkflowOperator/scalafixAll --check"` (clean), and the full `sbt
WorkflowOperator/test` module suite — 1967 succeeded, 0 failed, 2
pending.

### Was this PR authored or co-authored using generative AI tooling?

Co-authored by: Claude Code (Claude Fable 5)

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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.

3 participants