From: Ulrich-Matthias Schäfer Date: Sat, 27 Oct 2018 18:43:35 +0000 (+0200) Subject: resolve circular references and make example working again X-Git-Tag: 3.0.0~56^2~14 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c75fcaf02ceb144152d59557643c6fdd7264065;p=svg.js.git resolve circular references and make example working again --- diff --git a/abilities b/abilities new file mode 100644 index 0000000..4d5aa11 --- /dev/null +++ b/abilities @@ -0,0 +1,156 @@ + + +>> Element << + Stop + Bare + >> Parent << + Text + TextPath + >> Container<< + Doc + G + Symbol + Defs + ClipPath + Mask + A + Gradient + Shape + Rect + Circle + Path + Ellipse + Polygon + Polyline + Line + Image + +Animate +Box +Color +Controller + + +===================================================================== + + +classes: + + // MetaData + Title + + // Parents + SVG + G + + // Elements + Rect + Circle + Path + Ellipse + Polygon + Polyline + Line + Image + + // Text Stuff + TSpan + TextPath + + // Data Type + Box + Matrix + SVGNumber + SVGArray + PointArray + PathArray + Color + Controller + +abilities: + Animate + Container + Event + Doc + Movements + Dom + Create + + + + +// DocAbility.js + +import SVG from 'Svg.js' +export default function ( ...worksOn ) { + let workSet = new Set(worksOn) + return { + + doc: function () { + return this.parent(SVG) + } + + } +} + +-> svg.js -> DocAbility.js -> 'Svg.js' + +extend ( [ Rect ], DocAbility() ) + + + +// DomAbility.js + +import {makeInstance} from 'helpers.js' + +export default function ( ...worksOn ) { + let workSet = new Set(worksOn) + let maker = makeInstance(workSet) + + return { + + addTo (parent) { + return maker(parent).put(this) + } + + } +} + +class Rect { + + + static tagName = 'Rect' +} + + + + +new SVG[capitalize[node.nodeName]] + + + +new SVG.Doc() -> ...... + +// SVG.js + +extend( [ ...Parents ], Container(...Elements, ...Parents) ) ) +extend( [ Text ], Container( TSpan, TextPath ) ) + + + +Element.js + +new Element () + +export default class Element { + + static + + static + +} + +Rect.js + +import Element from Element.js +export default class Rect extends Element diff --git a/dirty.html b/dirty.html index f3e739a..5f605de 100644 --- a/dirty.html +++ b/dirty.html @@ -4,14 +4,7 @@ - - - - - - - - + @@ -30,7 +23,11 @@ -