Giter Site home page Giter Site logo

csjkevin / scale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antvis/scale

0.0 0.0 0.0 585 KB

๐Ÿ“ฆ Toolkit for mapping abstract data into visual representation.

Home Page: https://github.com/antvis/scale

License: MIT License

JavaScript 0.73% TypeScript 99.19% Shell 0.07%

scale's Introduction

@antv/scale

Toolkit for mapping abstract data into visual representation.

scale mapping

Build Status Coverage Status npm Version npm Download npm License

โœจ Features

  • Powerful: Ability to customize tickMethod are offered with abundant kinds of scales.
  • High performance: Use different methods to cache some state of scales to improve performance.
  • Fully embrace TypeScript: All code are written in TypeScript and complete type definition files are provided.

scale examples

๐Ÿ“ฆ Installation

$ npm install @antv/scale

๐Ÿ”จ Getting Started

  • Basic usage
import { Linear, LinearOptions } from '@antv/scale';

const options: LinearOptions = {
  domain: [0, 10],
  range: [0, 100],
};
const x = new Linear(options);

x.map(2); // 20
x.invert(20); // 2
x.getTicks(); // [0, 2.5, 5, 7.5, 10]
  • Customize tickMethod
import { Linear } from '@antv/scale';

const x = new Linear({
  domain: [0, 10],
  range: [0, 100],
  tickCount: 3,
  tickMethod: () => [0, 5, 10],
});

x.getTicks(); // [0, 5, 10]

๐Ÿ“Ž Links

๐Ÿ“ฎ Contribution

$ git clone [email protected]:antvis/scale.git

$ cd scale

$ npm i

$ npm t

Then send a pull request after coding.

๐Ÿ“„ License

MIT@AntV.

scale's People

Contributors

pearmini avatar yuzhanglong avatar hustcc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.