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

@maticoapp/matico_components

v1.0.4

Published

This project contains all the components needed to build a Matico App, the MaticoApp component it'self and the editor set up to modify components.

Downloads

4

Readme

Matico Components

This project contains all the components needed to build a Matico App, the MaticoApp component it'self and the editor set up to modify components.

Building the library

First install dependencies:

yarn install

To run in hot module reloading mode:

yarn run build-dev

To create a production build:

yarn run build-prod

Using the individual components

Each component can be used by itself disconected from the rest. Simple import it and use it like any other React component.

Bring your own components

While we have built each of the components within Matico to work well together, we know that you might want to replace them with your own. We are currently working on a depdendency injection system to allow you do just that. This would allow you to develop your own version of say a MaticoScatterPlotPane or MaticoMapPane and as long as it conforms to the interface of that Pane type, you should be able to easily swap it out.

Embedding a MaticoApp in your codebase

Each of the components can be used independently of one another or used in combination as a MaticoApp. To embed a MaticoApp on your own application simply install @maticoapp/matico_components using

yarn add @maticoapp/matico_components

then place the MaticoApp component as follows

import {MaticoApp} from '@maticoapp/matico_components'

export const AppContainer : React.FC<> = ()=>{
  return (
      <MaticoApp 
        spec={spec}
        basename={"http://yoursiteurl.com/path/to/embed/page"}
      />
  )
}

where spec is an instance of a MaticoAppSpec (see docs site for more info) and basename is the path to the root page the app is embeded in (MaticoApp will use prefixed to that url to handle internal routing).

Interacting with MaticoApp

If you want to have the rest of your app respone to events within Matio, for example new datasets being registered, the Matico state changing, you can do so by passing MaticoApp callbacks as so

import {MaticoApp} from '@maticoapp/matico_components'

export const AppContainer : React.FC<> = ()=>{
  return (
      <MaticoApp 
        spec={spec}
        basename={"http://yoursiteurl.com/path/to/embed/page"}
        onStateChange?: (state: VariableState) => void;
        onDataChange?: (data: MaticoDataState) => void;
        onSpecChange?: (data: Dashboard) => void;
      />
  )
}

where

  • onStateChange will fire whenever something in the app state changes
  • onDataChange will fire whenever the known datasets update (load etc)
  • onSpecChange will fire whenever the app specification changes.

Registering other data providers.

Matico can consume data from a number of sources however we know that you will likely want to extend that to other sources. To allow for this you can pass through an array of additional DataProviders to MaticoApp which will populate the Add Dataset pane within the editor.


import {MaticoApp} from '@maticoapp/matico_components'
import {MyDatasetProvider} from 'providers/MyDatasetProvider'

export const AppContainer : React.FC<> = ()=>{
  return (
      <MaticoApp 
        spec={spec}
        basename={"http://yoursiteurl.com/path/to/embed/page"}
        onStateChange= {(state: VariableState) => console.log(state)};
        onDataChange={(data: MaticoDataState) => console.log(data)};
        onSpecChange={(spec: Dashboard) => console.log(spec);
        datasetProviders= [MyDatasetProvider ]; 
      />
  )
}

DatasetProviders must implement the DatasetProvider interface


export interface DatasetProviderComponent{
  onSubmit : (datasetDetails: any) =>void
}

export interface DatasetProvider {
  name: string;
  description: string;
  component: React.FC<DatasetProviderComponent>;
}

Where DatasetProviderComponent describes the interface that needs to be implmented to produce the UI fro adding this dataset type