Repository navigation
Render a trace as an interactive Gantt chart with plotly - #406
Merged
Merged
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 4 minor |
🟢 Metrics 86 complexity · 0 duplication
Metric Results Complexity 86 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #406 +/- ##
==========================================
+ Coverage 89.53% 89.59% +0.06%
==========================================
Files 63 64 +1
Lines 16809 16999 +190
Branches 2581 2620 +39
==========================================
+ Hits 15050 15231 +181
- Misses 1341 1345 +4
- Partials 418 423 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 00:10
52b108d to
51f9842
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
from
September 19, 2026 00:10
6a78597 to
8c524f1
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 08:40
51f9842 to
024a917
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
from
September 19, 2026 08:41
8c524f1 to
2298ac8
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
2 times, most recently
from
September 19, 2026 09:15
af5698a to
40fff2d
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
2 times, most recently
from
September 19, 2026 09:17
48cea1d to
3e6ee1d
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 12:04
40fff2d to
62493ac
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
2 times, most recently
from
September 19, 2026 12:18
ff24b14 to
e26a301
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
2 times, most recently
from
September 19, 2026 13:22
4a7bbe7 to
b3168a2
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
from
September 19, 2026 13:22
e26a301 to
0140633
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 14:09
b3168a2 to
f48c306
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
from
September 19, 2026 14:09
0140633 to
193df3c
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 14:31
f48c306 to
e5560d1
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
2 times, most recently
from
September 19, 2026 14:42
40d9730 to
9fccd99
Compare
Paebbels
force-pushed
the
claude/tracing-collapsible-svg
branch
from
September 19, 2026 14:42
e5560d1 to
149adf5
Compare
Paebbels
force-pushed
the
claude/tracing-plotly-renderer
branch
from
September 19, 2026 15:30
9fccd99 to
808edbe
Compare
This was referenced Oct 18, 2026
Merged
Merged
Merged
Merged
Merged
Merged
Paebbels
reviewed
Oct 25, 2026
PlotlyRenderer draws a GanttLayout with plotly and writes it as an HTML page or as plotly's JSON: zoomable, with hover texts and legend entries hiding a category's bars. It takes the colors and the legend's text from the Renderer base-class, so both renderers show the same statistics; 'waiting for a runner' becomes QUEUED_LEGEND_LABEL next to LINE_LEGEND_LABEL. plotly joins the extra 'pyTooling[diagram]'; the glossary gains 'matplotlib', which was already referenced, and 'plotly'. Ported onto the renderer class of #404: RenderGantt/WriteGantt became PlotlyRenderer.Render/Write, and the legend functions of the first version are the base-class' methods now, tested through a renderer drawing nothing. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…tionInSeconds'. 'GanttLayout.Duration' is a timedelta on dev. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
…tring replacement for escaping. Review: - '_text', '_preformatted' and '_time' are the static methods '_EscapeText', '_Preformatted' and '_TimeAxisPosition'. - Each parameter is checked in its own chain: None -> ValueError, type -> TypeError, value -> ValueError. The loop over (name, value) pairs checked no type, so 'width="800"' failed with a TypeError of the '>' operator. - Escaping with 'str.replace' instead of 'html.escape': 'import html' costs 5-6 ms (cumulative, with 'html.entities'); a call is 11-25 % faster (24 characters: 136 -> 103 ns on 3.15, 143 -> 109 ns on 3.13). - 'includePlotlyJS' takes the new 'PlotlyJavaScript' enumeration (Embedded, CDN, DEFAULT) instead of 'True'/'cdn'. - Rules: no composed tuple assignments in 'Render', aligned assignment runs, one import statement and column, the non-breaking space written as '\u00a0', ASCII copyright line, the file written with 'open'. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Review (same pattern as in PlotlyRenderer): the loop over (name, value) pairs checked only that a value is positive. Every parameter is checked in its own chain now - None -> ValueError, type -> TypeError, value -> ValueError - including 'fontFamilies', 'legendLocation', 'collapsible' and 'collapsedKinds', which weren't checked. ':raises:' has one field per condition. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
This was referenced Oct 25, 2026
Paebbels
reviewed
Oct 25, 2026
…der an outer 'if' Patrick, on both renderers: * MatplotlibRenderer: 'width', 'rowHeight' and 'fontSize' had three copies of the same chain (None, 'float' or 'int', positive). They are checked in one loop over '(name, value)' pairs, as in pyEDAA.Reports' LLVM 'Segment', and the ':raises:' fields name the three parameters per condition. * PlotlyRenderer: the nullable 'width' is checked under an outer 'if width is not None:'. 'rowHeight' and 'fontSize' share a loop; for that, 'rowHeight' accepts a 'float' as well (default '20.0'), like 'fontSize' and like all three sizes of the matplotlib renderer. Plotly takes a fractional pixel height. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Paebbels
reviewed
Oct 25, 2026
…n a loop Patrick: a loop shares the code, not the documentation. 'width', 'rowHeight' and 'fontSize' (MatplotlibRenderer) and 'rowHeight' and 'fontSize' (PlotlyRenderer) get their three fields each again. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
Paebbels
reviewed
Oct 25, 2026
Patrick: a3fbc45 widened 'rowHeight' to 'float' only to let it share a loop with 'fontSize' - a type changed for the sake of the checks. It is an 'int' again (default '20'), checked in its own chain; 'fontSize' keeps its own chain too, as both differ in type. The outer 'if width is not None:' stays. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Rebased onto
dev(#405 is merged).GanttLayout.Durationis atimedeltathere, so the renderer readsDurationInSeconds(b8a5b50);doc/Dependency.rstrenders thediagramextra withdependency-tablealready.Ported onto
dev. #404 merged as a renderer class, so the plotly renderer is nowPlotlyRenderer(Renderer[Figure])instead of the functionsRenderGantt/WriteGantt. The legend functions the first version moved intopyTooling.Tracing.Renderare already there asRenderer's methods, so that part is gone from this pull-request.A chart of a big pipeline is hard to navigate as a static image: GHDL's
masterpipeline has 209 rows without steps and 1575 with the executed ones. This pull-request adds a second renderer, based on plotly, which writes the same Gantt chart as an interactive HTML page - zoomable, with hover texts and a legend that hides or shows categories.New Features
pyTooling.Tracing.Render.Plotly.PlotlyRendererPlotlyRenderer(layout, *, title, width, rowHeight, fontSize, includePlotlyJS)draws aGanttLayoutwith the same rows as the matplotlib renderer: labels indented by depth, the pipeline and called workflows as lines (dashed while running), jobs as bars colored by category, waiting bars in light gray, running bars hatched, and very short bars widened to a visible minimum.Rendererbase-class, so the legend shows the same statistics as the matplotlib chart: started and finished, wall time, runner time, and per category the number of jobs with minimum, average and maximum waiting and running times.TIME_AXIS_ORIGIN(1970-01-01): its ticks show the time since the trace began ashh:mm:ssand adapt when zooming.Write(file)writes an HTML page (.html) or plotly's JSON (.json), seeFORMATS.includePlotlyJStakes aPlotlyJavaScript:Embedded(the default) embeds plotly's JavaScript library (about 4 MiB), so the page works offline, e.g. downloaded from a pipeline's artifacts;CDNloads it from plotly's CDN.None→ValueError, type →TypeError, a non-positive size →ValueError.&,<,>bystr.replace), because plotly interprets HTML tags like<b>in titles, labels and hover texts.pyTooling.Tracing.Render.Plotly.PlotlyJavaScript- aStringEnumof how an HTML page loads plotly's JavaScript library.pyTooling.Tracing.Render.QUEUED_LEGEND_LABEL- waiting for a runner - joinsLINE_LEGEND_LABEL, and both renderers use it.pyTooling.Tracing.Render.Matplotlib.MatplotlibRendererchecks every parameter of its constructor the same way (width,rowHeightandfontSizein one loop); it checked only thatwidth,rowHeight,fontSizeanddpiare positive, andfontFamilies,legendLocation,collapsibleandcollapsedKindsnot at all.pyTooling[diagram]installsplotly >= 6.0in addition to matplotlib. MSYS2 needs no pacboy mapping: plotly is pure Python and installs from PyPI there.Documentation
doc/Tracing.rstgains a section Interactive HTML, and the matplotlib paragraph points to it.doc/News.rstlists the plotly renderer.doc/Glossary.rstgains the terms matplotlib and plotly -:term:matplotlib`` was used since Render a trace as a Gantt chart with matplotlib #404 without an entry.Unit Tests
tests/unit/Tracing/Render.py:Legend, 3 testcases:Renderer.FormatSeconds,Renderer.FormatTime, and a legend title and label whose columns align - through a renderer drawing nothing, so they run without matplotlib or plotly.Plotly, 13 testcases: the figure's title, rows, legend and time axis; bar positions, lengths, hover fields, the waiting bar on the job's row and the hatched running bar; solid and dashed lines; escaping; an HTML page with embedded and with CDN-loaded library; JSON; the errors for an unsupported suffix, a wrong file type and a wrong layout type; and every check ofwidth,rowHeight,fontSizeandincludePlotlyJS.Matplotlib.test_ParameterChecks: the new checks ofMatplotlibRenderer's parameters.tests/unit/requirements.txtaddsplotly >= 6.0.HTML pages were also generated from real runs - pyTooling/Actions run 34937615362 and ghdl/ghdl run 34887302325, each without steps and with the executed steps.
Known Issues
00:00:00.kaleido, which isn't a dependency. The matplotlib renderer writes static files.Related Issues and Pull-Requests