semagrams
A library for developing interactive semantic diagrams
Attributes
Members list
Type members
Classlikes
This class bundles the common arguments to many actions one might want to do in a binding so that you don't have to pass them in every time, and then provides a bunch of commonly used actions as methods.
This class bundles the common arguments to many actions one might want to do in a binding so that you don't have to pass them in every time, and then provides a bunch of commonly used actions as methods.
Attributes
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
The EntityType for Background
A Binding associates an IO returning A
action to events.
A Binding associates an IO returning A
action to events.
Attributes
- A
The type that the binding eventually returns
- docs
A description of the behavior of the binding, to be shown in a help screen.
- modifiers
If present, the event only matches if these KeyModifiers are down.
- selector
The function which says if an event "matches", and if so, what to do with it.
- Todo:
selector should be concrete data that implements a trait, and part of that trait is a description of the binding, like "Ctrl-click on a box" or "press a".
actually use docs
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Controllers manage global state. They have an apply
method which hooks
them up to whatever they need in the EditorState, and also adds the
right hooks to the main element.
Controllers manage global state. They have an apply
method which hooks
them up to whatever they need in the EditorState, and also adds the
right hooks to the main element.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
This is the main state for Semagrams.
This is the main state for Semagrams.
Even though we call this "state", notice that everything here is actually immutable. The state itself is all stored in Laminar stuff, like Vars and EventBuses.
We pass in dispatcher
and eventQueue
because this constructor can't run
in IO, and thus can't make them itself. It can however use the dispatcher
to attach the EventBus of events to the queue.
Attributes
- dispatcher
An IO dispatcher, used to bind the EventBus of events to
eventQueue
.- elt
The main svg element of the semagram.
- eventQueue
A queue to use for events. We might also throw things into this queue for testing purposes.
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
A reference to an logically distinct part of the Semagram, for instance a vertex, an edge, a ui element, etc.
A reference to an logically distinct part of the Semagram, for instance a vertex, an edge, a ui element, etc.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- class Backgroundclass SubEntityclass Parttrait SrcPortclass Boxclass Diagramtrait TgtPortclass Boxclass Diagramclass AnonEntity
A collection of entities and sprites
A collection of entities and sprites
Attributes
- em
- ordering
the order in which the sprites should be placed in the window. This matters for figuring out which sprite should be on top in the case of overlaps.
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- EntityCollection.type
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- EntityMap.type
A wrapper around a function which extracts a sequence of entity, sprite,
acset tuples from data of type A
and an EntityMap with
previously-extracted entities. The reason we have both something of type A
and an EntityMap is that we might want to query, for instance, the
boundary of a previously extracted vertex while constructing an edge.
A wrapper around a function which extracts a sequence of entity, sprite,
acset tuples from data of type A
and an EntityMap with
previously-extracted entities. The reason we have both something of type A
and an EntityMap is that we might want to query, for instance, the
boundary of a previously extracted vertex while constructing an edge.
Attributes
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
A basic implementation of Viewport that extracts entities using a sequence
of EntitySourcess from a signal of type A
.
A basic implementation of Viewport that extracts entities using a sequence
of EntitySourcess from a signal of type A
.
Later elements of entitySources
have access to the entities, sprites and
acsets extracted by previous elements.
Attributes
- Graph
- Supertypes
A runtime-introspectable type tag for an Entity.
A runtime-introspectable type tag for an Entity.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- object Background.typeclass SubEntityTypeclass PartTypetrait Obobject Box.typeobject InPort.typeobject OutPort.typeobject Wire.typeclass DynObobject E.typeobject V.typeobject I.typeobject O.typeobject S.typeobject T.typeobject Box.typeobject Wire.typeobject SrcPort.typeobject TgtPort.typeobject AnonEntity.type
Attributes
- Graph
- Supertypes
- trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- trait Enumtrait Serializabletrait Producttrait Equalstrait Propertyclass Objecttrait Matchableclass Any
Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Companion:
- enum
- Graph
- Supertypes
- trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- KeyModifier.type
Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Companion:
- enum
- Graph
- Supertypes
- trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- MouseButton.type
A subtrait of Property
that is simpler to implement when there's an
implicit ReadWriter for your value type in scope
A subtrait of Property
that is simpler to implement when there's an
implicit ReadWriter for your value type in scope
Attributes
- Graph
- Supertypes
- Known subtypes
A dependently-typed, persistent mapping from properties to values; the type of the value stored for a given property depends on the property.
A dependently-typed, persistent mapping from properties to values; the type of the value stored for a given property depends on the property.
We implement this internally with a Map
from Property to Any
, and
then enforce that only things of the right property are used by only
exposing well-typed insertion mappings.
Attributes
- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
An attribute that can be attached to an Entity.
An attribute that can be attached to an Entity.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- enum GenericProperty[T]trait PValue[T]object SName.typeobject TName.typeobject Program.typeobject Concentration.typeobject Rate.typeobject SName.typeobject TName.typeobject Src.typeobject Tgt.typeobject boxTy.typeclass diagTy[P]trait Attrtrait Homobject IS.typeobject IT.typeobject OS.typeobject OT.typeobject Src.typeobject Tgt.typeenum WireProp[T]
The abstract class that you create an instance of to create a Semagram
The abstract class that you create an instance of to create a Semagram
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
A Sprite contains the information necessary to turn a sub-ACSet into a reactive SVG on the screen.
A Sprite contains the information necessary to turn a sub-ACSet into a reactive SVG on the screen.
TODO: Sprites should have an "injection" method for statically computing some layout that they want to have available for boundaryPt/bbox queries, or simply adding default properties. This injection is called before present, and the result is saved in the EntityMap. Currently, each sprite has some custom code for being able to have defaults; that should not be custom because then it is inconsistent.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- class Arrowclass DPBoxclass Discclass GenericHTMLSpriteclass Rectclass Wireclass WireStubclass WithMiddleware
An entity that is logically a part of the parent
An entity that is logically a part of the parent
Attributes
- Todo:
I'm not sure we really use this; is this necessary?
- Graph
- Supertypes
The EntityType for SubEntitys
A bit of state storing the current affine transform of a viewport.
A bit of state storing the current affine transform of a viewport.
Currently unused.
Attributes
- Todo:
use this for zooming/translation
maybe just use a
Var[Transform]
directly?- Companion:
- object
- Graph
- Supertypes
- trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Attributes
- Companion:
- class
- Graph
- Supertypes
- trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
- TransformState.type
A semagrams app is split into several viewports.
A semagrams app is split into several viewports.
The reason for this is that we might want to apply different affine transformations to different parts of the app. For instance, we might have UI elements in one viewport, and the main acset in another viewport, so that we can zoom out on the main acset without making all of the buttons tiny.
Currently transforms are unimplemented; however this was just the result of an incomplete refactor, and it should be straightforward to add them back.
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- class EntitySourceViewport[A]
Types
Value members
Concrete methods
This creates the svg element that will all of the Semagrams activity
This creates the svg element that will all of the Semagrams activity
Attributes
Matches events equal to ev
Matches events equal to ev
Attributes
Matches clicks on entities with button
, returns the entity clicked on.
Matches clicks on entities with button
, returns the entity clicked on.
Attributes
Matches clicks on entities of entity type ty
with button button
, returns
the entity clicked on.
Matches clicks on entities of entity type ty
with button button
, returns
the entity clicked on.
Attributes
Matches clicks on parts of part type ty
with button button
, returns the
part clicked on.
Matches clicks on parts of part type ty
with button button
, returns the
part clicked on.
Attributes
Matches clicks on parts with button button
, returns the part clicked on.
Matches clicks on parts with button button
, returns the part clicked on.
Attributes
clickOnPart for doubleclicks
clickOnPart for doubleclicks
Matches keydown events for key
Matches keydown events for key
Attributes
Matches keyup events for key
Matches keyup events for key
Attributes
Matches a ContextMenu event on an entity, returns that entity.
Matches a ContextMenu event on a part of any type, returns that part.
Matches a ContextMenu event on a part of a specific type, returns that part.
Matches a mouseup event either on or off an entity, returns an option of an entity.
Matches a mouseup event either on or off an entity, returns an option of an entity.
Attributes
Matches mouseup events on that are on an entity, returns that entity
Matches mouseup events on that are on an entity, returns that entity