blob: 1775a118892a3755a6d579f638ad667f2c364c1b [file] [log] [blame]
Simon Hunt7ac7be92015-01-06 10:47:56 -08001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 ONOS GUI -- SVG -- Glyph Service
19
20 @author Simon Hunt
21 */
22(function () {
23 'use strict';
24
Simon Hunt51fc40b2015-01-06 13:56:12 -080025 var $log,
26 glyphs = d3.map();
Simon Hunt7ac7be92015-01-06 10:47:56 -080027
28 angular.module('onosSvg')
29 .factory('GlyphService', ['$log', function (_$log_) {
30 $log = _$log_;
31
Simon Hunt51fc40b2015-01-06 13:56:12 -080032
33 function init() {
34 // TODO: load the core set of glyphs
35
36 }
37
38 function register(viewBox, data, overwrite) {
39 // TODO: register specified glyph definitions
40
41 }
42
43 function ids() {
44 return glyphs.keys();
45 }
46
47 function loadDefs(defs) {
48 // TODO: clear defs element, then load all glyph definitions
49
50 }
51
Simon Hunt7ac7be92015-01-06 10:47:56 -080052 return {
Simon Hunt51fc40b2015-01-06 13:56:12 -080053 init: init,
54 register: register,
55 ids: ids,
56 loadDefs: loadDefs
Simon Hunt7ac7be92015-01-06 10:47:56 -080057 };
58 }]);
59
60}());