Skip to content

music-stats/map

Repository files navigation

music-stats map

license code size

screenshot

Tech stack

dev deps: typescript, sass, webpack, jest.

deps: leaflet, d3-scale, d3-scale-chromatic, d3-color, micro-conductor, htm + vhtml + classnames.

Data sources and assets

There are two files the map relies on:

Flags (1x1) are taken from flag-icon-css.

Implementation details

No rendering/templating framework is used, though UI consists of several component-like (React-inspired) classes.

You can always find a .render() method there - in <PlaycountMap /> it assembles children components together, in other (presentational) components it returns HTML as a string (using htm based on tagged templates) and relying on .props + .state.

DOM event handlers are bound through .subscribe() methods.

Presentational components actually extend Leaflet's Control, so .onAdd() is implemented there (responsible for .element rendering).

Styles are organized as SASS files alongside the components. BEM methodology is used for naming.

Setup

Environment variables

Create a .env file and fill its values according to .env.template:

Commands

$ npm ci              # install deps
$ npm run lint        # lint scripts and styles
$ npm test            # run unit tests
$ npm run dev         # run a local dev server
$ npm run build:prod  # produce a build artifact
$ npm run deploy      # deploy to GitHub pages

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •