Skip to content

Files

This branch is 2 commits ahead of, 163 commits behind d3fc/d3fc:master.

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 5, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
May 5, 2020
Sep 23, 2020
Sep 23, 2020
May 5, 2020
May 5, 2020
Sep 23, 2020
Sep 23, 2020
Aug 2, 2021
Sep 23, 2020
Oct 26, 2020
Oct 26, 2020
Sep 23, 2020
Oct 14, 2020
Sep 29, 2020
Jun 21, 2022
Nov 5, 2020
Sep 23, 2020
May 5, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Apr 28, 2021
Sep 23, 2020
May 5, 2020
May 5, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
Sep 23, 2020
May 5, 2020
Nov 5, 2020
Nov 5, 2020
May 5, 2020
Apr 30, 2020
May 5, 2020
Feb 3, 2020
Jan 28, 2020

Examples

This directory contains a set of examples utilising various d3fc features.

Viewing the examples

Just load up one of the */index.html files in a browser. Where appropriate the */README.md file will give further instructions.

N.B Some of the tests require a webserver to be running in order for data files to be served correctly. This can be done by running npm start from the project root.

Regenerating screenshots

Start up an HTTP server e.g. -

npx http-server

Then run the following -

npm run bundle
npm run examples -- --testNamePattern image --updateSnapshot
npm run examples -- --testNamePattern image

The script that livereload injects has been known to cause issues with determinism. Depending upon the version of Chromium, Math.random() can be invoked by livereload, which then changes the value of subsequent invocations.

To avoid this we bundle without the livereload script and use a vanilla HTTP server. We run the tests twice to ensure determinism.

Regression testing

First the performance tests need baselining for the machine they are being run on. Check out the code prior to the change under test and run -

HEADLESS=false EXECUTABLE_PATH="path_to_chrome\chrome.exe" npm run examples -- --updateSnapshot

At this stage the */__tests__/__snapshots__ files will have been updated with the baseline performance figures and the __tests__/__image_snapshots__ files with the visual output of the examples.

Check out the code containing the change under test and run -

HEADLESS=false EXECUTABLE_PATH="path_to_chrome\chrome.exe" npm run examples

Any errors at this stage should correlate with known changes to either the performance or visual output of the examples (please don't ignore non-determinism).

It is advised that the HEADLESS and EXECUTABLE_PATH environment variables are set as puppeteer does not use the GPU in headless mode.

The BASE_URL environment variable can also be used to change the base URL of the examples in the tests.