New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ticktext

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ticktext

utility for radial svg text placement for dials and gauges

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

WIP

A small utility to correct the alignment of radially positioned SVG text elements.

Purpose

When placed radially, like on a gauge or dial, SVG text elements can look awful unless their positions are corrected for the eye.

In the following illustration, the red elements show text placement on the basis of polar to cartesian coordinates. The green elements illustrate the correction made by the ticktext function.

SVG Text Alignment and Correction

Installation

npm install --save ticktext

Usage


import ticktext from 'ticktext';


const originalCoordinate = {x: 100, y: 100};
const angle = 90; // degrees
const text = '000'
const fontSize = 12;
const inside = true;


const newCoordinate = ticktext(originalCoordinate, angle, text, fontSize, inside);



FAQs

Package last updated on 20 Mar 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