Skip to content

Customizing Essence Language Symbol Stencils

Jinyoung Jang edited this page Nov 11, 2015 · 3 revisions

Look at the file OpenGraph.js

inside the javascript, there are constructors for each symbols and you can find the logics for drawing graphics:

OG.shape.essencia.Alpha.prototype.createShape = function () {
var geom1, geomCollection = [];

if (this.geom) {
	return this.geom;
}

geom1 = new OG.geometry.Rectangle([0, 0], 90, 100);

geomCollection.push(geom1);
geomCollection.push(new OG.geometry.Line([90, 50], [100, 0]));
geomCollection.push(new OG.geometry.Line([90, 50], [100, 100]));

this.geom = new OG.geometry.GeometryCollection(geomCollection);

this.geom.style = new OG.geometry.Style({
	'r' : 20,
	'label-position': 'center',
    'stroke-width' : 2.5
});

return this.geom;
};