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

job-market-visuals

v2.1.0

Published

job-market-visuals React component

Downloads

4

Readme

Udir data visualization tools

This module contains the dataviz tool to generate working market bar/tree charts for the utdanning.no website.

Components

There's a component for each context. Under the hood they use similar components to render the visualizations. The individual contexts provide a little bit more control in case we need to add more UI elements or built-in disaggregations.

<Context2 />

import { Context2 } from "job-market-visuals"

const MyComponent = () => {
  return (
    <div>
      <Context2
        id="y_sykepleier"
        direction="uno_id2styrk08"
        limit={8}
      />
    </div>
  )
}

You can freely disaggregate data by using the disaggregateBy and disaggregateLabels props.

Props

| Name | Type | default | | ------------------ | ---------------- | ---------------- | | id | String | y_sykepleier | | direction | String | uno_id2styrk08 | | layout | bars/tree | bars | | limit | Number | 8 | | disaggregateBy | Array of Strings | | | disaggregateLabels | Array of Strings | | | colors | Object | | | missingDataText | String | Missing data |

<Context 3/>

import { Context3 } from "job-market-visuals"

const MyComponent = () => {
  return (
    <div>
      <Context3
        id="y_sykepleier"
        direction="uno_id2styrk08"
        limit={8}
      />
    </div>
  )
}

Props

You can freely disaggregate data by using the disaggregateBy and disaggregateLabels props.

| Name | Type | default | | ------------------ | ---------------- | ---------------- | | id | String | y_sykepleier | | direction | String | uno_id2styrk08 | | layout | bars/tree | bars | | limit | Number | 8 | | disaggregateBy | Array of Strings | | | disaggregateLabels | Array of Strings | | | colors | Object | | | missingDataText | String | Missing data |

Hooks

useData

The useData hook can be used to load relevant data from the API endpoint. To use it, just include an id and a direction.

import { useData } from "job-market-visuals"

const MyComponent = () => {

  const data = useData("y_sykepleier", "uno_id2styrk08")

  return (
    <div>{"..."}</div>
  )
}

Layouts

To determine the layout (bars/tree), you can pass a layout prop with a string of either bars or tree to the visualizaiton component.

<Context2
  id="u_bioingeniorfag"
  limit={8}
  layout="tree"
/>

Disaggregations

In order for the chart to show a disaggregated view of the data, you have to pass an array of strings to identify which keys to use for disaggregation.

Here is an example of the gender disaggregated chart:

<Context2
  id="u_bioingeniorfag"
  limit={8}
  disaggregatedBy={["antall_kvinner", "antall_menn", "antall_ukjent_kjonn"]}
  disaggregateLabels={["kvinner", "menn", "ukjent kjonn"]}
/>

Here is an example of the sector disaggregated chart:

<Context2
  id="u_bioingeniorfag"
  limit={8}
  disaggregatedBy={["antall_offentlig", "antall_privat", "antall_ukjent_sektor"]}
  disaggregateLabels={["Offentlig", "Privat", "Ukjent sektor"]}
/>

Here is an example of the age disaggregations:

<Context2
  id="u_bioingeniorfag"
  limit={8}
  disaggregatedBy={["antall_40", "over_40"]}
  disaggregateLabels={["under 40", "Over 40"]}
/>

Here is an example of the experience disaggregations:

<Context2
  id="u_bioingeniorfag"
  limit={8}
  disaggregatedBy={["antall_13", "antall_710", "other_experience"]}
  disaggregateLabels={["1-3 years", "7-10 years", "Other"]}
/>

*Note: Don't forget to pass disaggregateLabels in order to provide a user-friendly string to display in the tooltips. By default the basic amount of labeled as "personer".

Colors

In order to determine the look of the visualization, you can pass a set of colors to the visualization component. Here are all the options:

<Context2
  id="u_bioingeniorfag"
  limit={8}
  colors={{
    text: "#333",
    textTree: "#333",
    primary: "#ff9800",
    disaggregations: ["#ffcc80", "#f57c00", "#ddd"],
    notWorking: "#ff5722",
    unemployed: "#f44336",
    inEducation: "#ff9800",
    selfEmployed: "#ff9800",
    other: "#9e9e9e",
  }}
/>