🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

cartojss

Package Overview
Dependencies
Maintainers
13
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cartojss

Serializer of CartoCSS javascript objects

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
13
Created
Source

CartoJSS

Build Status js-semistandard-style

NPM

Generate CartoCSS and Turbocarto ramps from a JavaScript object

Install

$ npm install cartojss

Usage

var cartojss = require('cartojss');

var style = {
  '@small': 3,
  '@large': 6,
  '#layer': {
    'marker-width': '@small',
    'marker-allow-overlap': true,
    '[zoom = 4]': {
      'marker-width': '@large'
    }
  },
  '#selector': {
    'line-dasharray': [1, 4, 2],
    'marker-width': 'ramp([price], (10, 20, 30), jenks())'
  },
  '#world': {
    'text-name': '"[NAME]"',
    'text-size': 11,
    'text-face-name': ['"Georgia Regular"', '"Arial Italic"']
  }
}

cartojss.serialize(style, { pretty: true });
@small: 3;
@large: 6;
#layer {
  marker-width: @small;
  marker-allow-overlap: true;
  [zoom = 4] {
    marker-width: @large;
  }
}
#selector {
  line-dasharray: 1, 4, 2;
  marker-width: ramp([price], (10, 20, 30), jenks());
}
#world {
  text-name: "[NAME]";
  text-size: 11;
  text-face-name: "Georgia Regular", "Arial Italic";
}

Options

pretty

Type: Boolean
Default: false

Serialize pretty CartoCSS

Development

yarn
yarn test

Publish

npm version patch|minor|major
npm publish

Browsers support made by godban

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
IE11, Edgelast 3 versionslast 3 versionslast 3 versions

FAQs

Package last updated on 25 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts