Refactoring PyChart
summary
Refactors PyChart by making imports explicit, turning package module imports into direct class imports, and packaging class imports into a single pypchart module; it isolates file/format handling into a separate canvas/file-object layer, removes entangled globals, and makes output generation embeddable instead of relying on Python's exit hook. Tests use the shipped demo suite as regression checks (visual comparison done manually). Output formats include PDF, SVG, PostScript, PNG and planned HTML5 canvas output. Key changes: removed global state, extracted file backend classes.
AI-written summary · about
chapters (11)
- 0:00Refactoring PyChart
- 0:49Principles of refactoring
- 2:49Refactoring cycle - no interface change
- 4:01Refactoring with interface change
- 4:42Typical refactorings
- 8:31Why refactor
- 12:18Refactoring steps
- 16:43Separation of concerns
- 19:41Output generation
- 20:58Piechart
- 22:39Summary
related talks
05mPykCharts.js
38mBuilding a maintainable plotting library-PyData NYC
37mData visualization with plotly py: Version 3 and beyond
30mFrom plotting to chart porn - Creating slick charts with Matplotlib
26mSankey Plots with Python
28mThe bumps in the road: A retrospective on my data visualisation mistakes
29mInteractive visualization for the curious
28mThe Missing Abstraction of Charting
