npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

somehow

v0.3.5

Published

make infographics without thinking

Downloads

30

Readme

somehow creates SVG, using your data, that you can throw-into your webpage.

let somehow = require('somehow')

let world = somehow({
  height: 300,
  aspect: 'golden'
})

let line = world.line()
line.set(`
june 5 2019, 10
july 7 2019, 15
july 7 2020, 18
aug 8 2021, 50
`)

world.fit()

document.body.innerHTML = world.build()

image

the idea is that you think (mostly) about the actual data, and not the layout.

#1 - .fit()

this scales, and fits the data for all given shapes, automatically. You don't have to manage d3Scale range & domain.

#2 - .build()

running .build() returns html-strings by default, but the library uses Jason Miller's htm library so can call .bind(React.createElement) and return React Components.

The joke is that D3 is easy, as long as you're an expert.

This library is built for personal use, and is essentially a wrapper for d3-path, d3-shape, and spacetime.

more to come!

Current API:

- line(obj)
- dot(obj)
- text(obj)
- area(obj)
- midArea(obj)
- rect(obj)
- bar(obj)
- annotation(obj)
- image(obj)
- arrow(obj)
- snake(obj)
- shape(obj)

- bind(fn)
- xAxis
- yAxis
- fit(x, y)
- fitX(x)
- fitY(y)
- build()
- getShape(id)
- redraw()
- clip(bool)
- title(str)

Axis

- color(c)
- remove()
- show()
- format(str)
- ticks(arr)
- prefix(str)
- suffix(str)
- clip(bool)
- label()

Shape

- set(str)
- at(x, y)
- from(x, y)
- to(x, y)
- color(c)
- opacity(n)
- title(str)
- straight()
- soft()
- onMount(fn)
- click(fn)
- hover(fn)
- clip(bool)

Area

- line(n)

Rect

- color()
- width(n)
- height(n)
- rounded(n)
- border(n)

Line

- dotted()
- width()

Text

- before(x, y)
- after(x, y)
- center(x, y)
- left()
- right()
- middle()
- color(c)
- dy(num)
- dx(num)
- dodge(x, y)
- font(num)
- extent()
- text(str)

Dot

- radius(num)

Annotation

- on(x, y)
- title(str)
- nudge(x, y)

MidArea

- zero(y)

Bar

- width()
- zero()
- at(x, y)

Image

- src(txt)
- caption(str)
- size(w, h)
- width(w)
- height(h)

Arrow

- from(x,y)
- length(num)
- width(num)

Now

- top()
- bottom()
- label(str)

Title

- top()
- bottom()
- right()
- left()

MIT