Skip to content

Latest commit

 

History

History
107 lines (80 loc) · 4.03 KB

CONTRIBUTING.md

File metadata and controls

107 lines (80 loc) · 4.03 KB

Build the code

$ mvn clean install

For building and minifying CCC:

$ mvn -Dbuild-config=release clean install

Test the code

Install karma

$ npm install -g karma-cli

Then run

$ karma start ccc-js/src/test/config/javascript/karma.conf.js

Generate the options documentation

$ ./scripts/generateJsDocs.sh

Site chart-type pages

The CCC site has one HTML page per chart type, each containing several live examples and summary documentation of its options and extension points.

The pages are loaded in an iframe, from CCC's site main page, through a chart type selector.

Pages are based on a template composed by:

  1. Page header: site/resources/cccExampleHeader.html;
  2. Examples section, containing several examples, generated by the XSLT template site/gen/genTemplates.xsl, from the examples registered in site/gen/templates.xml, and whose code is in files placed under site/resources;
  3. Options and Extension points summary sections, generated by the XSLT template doc/gen/summary/com2html-summary.xsl, from the information in CCC's XML docs;
  4. Page footer: site/resources/cccExampleFooter.html.

Stylizing

For markup related changes to each example's template, the XSLT template must be modified. If you don't have mastery of XSLT, and the changes are small enough, you should have no problem: just concentrate on the HTML elements, that you'll surely recognize. Remember that a XSLT file is an XML file, and so XHTML markup must be used (it's known to not be forgiving of missing closing tags and such).

For CSS and Script related changes, first check the chart site/resources/cccExampleHeader.html file.

You may need to change the CSS and JS files that specifically exist to support the chart type pages. These files are placed under site/root/charts/lib. These are copied to the site's output folder when the site is generated.

Notice besides the site/root/charts folder, the remaining content under site/root is only used to help the development of the chart type pages, and is not deployed to the actual site, where the same, or similar, surrounding context is expected to exist.

Modifying an example

If you want to change the options of an example (the color scale?), you should directly modify the specific example's file. Each example has a corresponding code file, placed under site/resources. The files are numbered according to their registration index in site/gen/templates.xml.

Generating

Make sure you have built the code and generated the JavaScript options' documentation. Then, run:

$ ./scripts/generateSite.sh

Go to target/site/charts/ and check if the generated chart type pages look and behave like you want.

A simple way to test the site output is to run the following from the /target/site directory

$ python -m SimpleHTTPServer 8000

Deploying

Finally, deploy the changes to the CCC's site, by updating the gh-pages branch with the generated files under target/site/charts/.