GUI -- implemeted GlyphService.loadDefs().
Change-Id: I2d93164dd6d1968982d3034b8c7bc50041d9bad9
diff --git a/web/gui/src/main/webapp/app/fw/svg/glyph.js b/web/gui/src/main/webapp/app/fw/svg/glyph.js
index 2afc102..8129c16 100644
--- a/web/gui/src/main/webapp/app/fw/svg/glyph.js
+++ b/web/gui/src/main/webapp/app/fw/svg/glyph.js
@@ -161,9 +161,17 @@
return glyphs.get(id);
}
+ // Note: defs should be a D3 selection of a single <defs> element
function loadDefs(defs) {
- // TODO: clear defs element, then load all glyph definitions
+ // remove all existing content
+ defs.html(null);
+ // load up the currently registered glyphs
+ glyphs.values().forEach(function (g) {
+ defs.append('symbol')
+ .attr({ id: g.id, viewBox: g.vb })
+ .append('path').attr('d', g.d);
+ });
}
return {