Demo bring your own html and svg - #1
Merged
Merged
Conversation
Demonstrate the bring-your-own-HTML path: a new A4 "Sales Dashboard" sample composes pie, bar, and line charts as inline SVG (SVG 1.1 core) injected via addRawHtml, so the same document renders in browsers, WebView, and — with the new Batik drawer — the desktop PDF. - spooler desktop: add openhtmltopdf-svg-support and register BatikSVGDrawer so inline SVG renders in generated PDFs. - demo: Charts.kt builds the three chart SVGs from plain data; salesDashboard document wires them; new card appears in the demo. - tests: ChartsTest covers SVG structure; a desktop integration test renders inline SVG to a real PDF.
…mples Promote the chart builders (pieChartSvg/barChartSvg/lineChartSvg + Slice/Bar/ Point) from the demo into spooler commonMain as public, KDoc'd API, reusing the library's escapeHtml; move ChartsTest alongside them. Add three literal bring-your-own-HTML demo samples that use no drawing code: - Promo Flyer and Member Card — whole documents authored as inline-styled HTML passed to addRawHtml (logo embedded as a data URI). - Sales Report — a report snippet embedding a chart as an <img> PNG; the PNG is a library barChartSvg pre-rendered once to a base64 constant in ChartImage.kt. The Sales Dashboard sample now consumes the library chart API. Update the spec.
The library is not a charting library, so drop pieChartSvg/barChartSvg/ lineChartSvg and the Slice/Bar/Point types from spooler. Add one generic UnifiedDocument.addSvg(svg) that embeds any SVG graphic as a centered block, rendered into the desktop PDF by the Batik drawer. Demo: draw a single bar chart with demo-local code (BarChart.kt) and embed it in the Sales Report via addSvg. Drop the multi-chart Sales Dashboard and the PNG-image report. Promo Flyer and Member Card are unchanged.
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.
No description provided.