feat(site): fix headless rendering, add Fixes & PRs gallery, standalone getChart() conversions, README update#940
Merged
Conversation
Points readers to the GitHub Pages site as a no-install way to browse all chart types before running the demo app locally. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add public static getChart() to all TestForIssueNNN and TestForPRNNN classes that lacked it, enabling headless rendering for the xchart-site gallery. main() methods are preserved unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…llery page - Add java.awt.headless=true system property to exec-maven-plugin config so charts using setToolTipsEnabled/setZoomEnabled render correctly on CI - Improve error logging: print full stack trace instead of just e.getMessage() (which returns null for NPEs) - Add generateFixesPage(): scans standalone.issues and standalone.prs packages, renders each TestForIssueNNN/TestForPRNNN chart, and emits fixes.html with cards linked to the corresponding GitHub issue or pull request - Add shared buildHeader()/buildFooter() helpers; index.html and fixes.html now share a navigation bar with Gallery and Fixes & PRs links - Add CSS for .gh-link, .chart-no-image placeholder, and active header nav link Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous edit replaced only the import block but left the original GenerateSite class body intact after the new one, causing a duplicate class compiler error on CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What and why
This PR ships several improvements to the XChart GitHub Pages site (
xchart-sitemodule).1. Fix missing chart images (headless AWT)
About 40% of charts on the live site rendered as broken images. Root cause: charts using
setToolTipsEnabled(true)orsetZoomEnabled(true)try to initialize Swing/AWT components that require a display, causing an NPE on headless Linux CI runners.Fix: Add
java.awt.headless=trueas a system property in theexec-maven-pluginconfig inxchart-site/pom.xml. Also improved error logging to print the full stack trace (previouslye.getMessage()silently returnednullfor NPEs).2. Fixes & PRs gallery page (
fixes.html)A new page that:
standalone.issuesandstandalone.prspackages for allTestForIssueNNN/TestForPRNNNclassespublic static getChart()methodgithub.com/knowm/XChart/issues/NNNor.../pull/NNNTestForIssue27_1(strips suffix before parsing number)getChart()method3. Standalone test class conversions (43 files)
All
TestForIssueNNNandTestForPRNNNclasses inxchart-demohave been updated to expose apublic static getChart()method, making them usable fromGenerateSitewithout a display. Patterns used:getChart*()methodsmain()4. Shared navigation
Both
index.htmlandfixes.htmlshare abuildHeader()/buildFooter()with a top nav (Gallery | Fixes & PRs | GitHub | Maven Central), with the active page highlighted.5. README update
Added a "Chart Gallery" section above the demo instructions linking to
https://knowm.github.io/XChart/.CSS additions
.gh-link- GitHub link on fix cards.chart-no-image/.no-image-label- placeholder for unrenderable charts.header-links a.active- highlights current page in nav