Polymer component for The Times' Budget 2017 D3 treemap
To run this code locally:
-
Clone this GitHub repository
-
Install the dependencies
$ npm install && bower install
- Start the development server
$ npm run start
To create a built version of the component, run:
$ npm run dist
The app/times-treemap
folder contains three files that comprise the web
component:
index.html
for the component's HTML structurescript.js
for the component logic, which should be built around Polymer's lifecycle hooksstyle.scss
for the component's styles (as SASS)
Web Component Tester (WCT) is included to support testing. Tests can be written
in test/times-treemap.html
.
Settings can be tweaked in wct.conf.json
.
Third-party components can be included using Bower (as mandated by Polymer).
On npm run build
, the separate component files will be bundled together and
then Vulcanized, which inlines
dependencies.
To prevent a dependency being inlined (for example, if the dependency is hosted
on the Times components server) you can add it to the excludes
array in
scripts/vulcanize.js
.
Polymer itself should always be excluded from the Vulcanize process.