API Documentation - LanceJernigan/Squiggle GitHub Wiki

API References

Particle Accelerator

<Particles id={0} classification="ALL">
    <Pattern classification="classification" component={} expanded={} />
</Particles>

Particles

Will retrieve particles from store and map over the query passing the individual particle data to the supplied component (will default to Pattern) if no component is supplied. Particles components can be nested within individual particles.

Arguments

  • {id = 0} - (int) - The id of either the particle itself (if passed with a classification) or the parent Particle if classification="ALL"
  • {classification = "ALL"} - (string) - The classification of the particles being filtered

Returns

  • Individual particles displayed using, either, component or expanded component (if supplied)

Pattern

All patterns should be stored within the patterns folder to remain unified

Will be used for as a template for the specified classification of particle. Patterns will have one of two states, expanded or compressed, represented by an {expanded = false} variable passed to the individual Particle

Arguments

  • {classification} - (string) - Classification of particle to use pattern
  • {component} - (component) - Component to use for particle
  • {expanded = {component}} - (component) - Component to use for particle if no sibling particles are present

Returns

  • Nothing (is used for templating purposes)

Example

The example below will display the title and subject of the particle supplied to it.

import React from 'react'

require('../style/Project.scss')

const Project = ({particle}) => {

    <h1>{particle.title}</h1>
    <h3>{particle.subject}</h3>

}

export default Project
⚠️ **GitHub.com Fallback** ⚠️