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

ammunition

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ammunition

Modern cartridges drawn to spec with D3v4

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

Ammunition.js

This library is currently a work in progress. Modern cartridges drawn to specifcations with D3v4. Dimensions are based on SAAMI with tolerances averaged. Only specifications for SAAMI pistol and rifle cartridges are presently available.

Installation

  • Install package
npm install ammunition
  • Include d3v4 and ammunition.js on your page.
<script src="path/to/d3.js" />
<script src="path/to/ammunition.js" /> 

Usage

To draw a cartridge:

<script>

let round = new Ammo({
      element: document.querySelector('.foo'),
      name:'7.62x39',
      bullet: 'rifle',
      stroke: '#323232'
    });

</script>

<div class="foo"></div>

element: Specifies the element the cartridge SVG is to be drawn on.

name: Specifies which cartridge to be drawn. Name is based on SAAMI nomenclature.

bullet: type of bullet on cartridge. Currently only supports rifle and standard (round nose type). If left empty will default to value in specification.

stroke Specifies the stroke color of cartridge. Defaults to #333 if left blank.

LICENSE

MIT

Keywords

ammunition

FAQs

Package last updated on 27 Dec 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