BoundingBox Class
Utility object that encapsulates Y.Models and keeps their position state within an SVG canvas.
As a convenience attributes of the encapsulated model are exposed directly as attributes.
Item Index
Methods
BoundingBox
-
module -
model
Parameters:
-
moduleModuleTypically service module.
-
modelModelModel object.
Returns:
DecoratedRelation
-
relation -
source -
target
Decorate a relation with some related/derived data.
Parameters:
-
relationObjectThe model object we will be based on.
-
sourceObjectThe service from which the relation originates.
-
targetObjectThe service at which the relation terminates.
Returns:
generateHash
-
value
Create a hash of a string. From stackoverflow: http://goo.gl/PEOgF
Parameters:
-
valueStringThe string to hash.
Returns:
generateSafeDOMId
-
value
Create a stable, safe DOM id given an arbitrary string. See details and discussion in https://bugs.launchpad.net/juju-gui/+bug/1167295
Parameters:
-
valueStringThe string to hash.
Returns:
isGuiCharmUrl
-
charmUrl
Determine if a service is the Juju GUI by inspecting the charm URL.
Parameters:
-
charmUrlStringThe service to inspect.
Returns:
isGuiService
-
candidate
Determine if a service is the Juju GUI by inspecting the charm URL.
Parameters:
-
candidateObjectThe service to inspect.
Returns:
isPythonRelation
-
relationId
Check whether or not the given relationId represents a PyJuju relation.
Parameters:
-
relationIdStringThe relation identifier.
Returns:
toBoundingBoxes
-
Module -
services -
existing
Covert an Array of services into BoundingBoxes. If existing is supplied it should be a map of {id: box} and will be updated in place by merging changed attribute into the index.
Parameters:
-
ModuleServiceModuleholding box canvas and context.
-
servicesModelListService modellist.
-
existingObjectid:box mapping.
Returns:
toString
-
value
Translate a value into a string, translating non-values into an empty string.
Parameters:
-
valueObjectThe value to stringify.
