Skip to content

Instantly share code, notes, and snippets.

@LevelbossMike
LevelbossMike / machine.js
Created November 22, 2022 10:07
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@LevelbossMike
LevelbossMike / machine.js
Last active November 22, 2022 09:58
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@LevelbossMike
LevelbossMike / machine.js
Created August 12, 2022 11:59
Editior machine - for statechart visualizer
Machine({
id: 'editor',
type: 'parallel',
states: {
selection: {
initial: 'idle',
states: {
idle: {
on: {
SELECT: {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@LevelbossMike
LevelbossMike / README.md
Created July 29, 2022 14:15 — forked from jose-mdz/README.md
Orthogonal Diagram Connector

Orthogonal Connectors

This algorithm returns the points that form an orthogonal path between two rectangles.

How to Use

// Define shapes
const shapeA = {left: 50,  top: 50, width: 100, height: 100};
const shapeB = {left: 200, top: 200, width: 50, height: 100};
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class extends Component {
get context() {
return JSON.stringify(this.args.machine.machine.context)
}
@action
updateContext() {
import Component from '@glimmer/component';
export default class extends Component {
}
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
Machine({
initial: 'pageA',
states: {
pageA: {
initial: 'unknown',
states: {
unknown: {
on: {
'': [
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions