summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/web/gui/src/main/webapp/_bripc
diff options
context:
space:
mode:
authorCNlucius <lukai1@huawei.com>2016-09-13 11:40:12 +0800
committerCNlucius <lukai1@huawei.com>2016-09-13 11:41:53 +0800
commitb731e2f1dd0972409b136aebc7b463dd72c9cfad (patch)
tree5107d7d80c19ad8076c2c97c2b5ef8d1cf3ab903 /framework/src/onos/web/gui/src/main/webapp/_bripc
parentee93993458266114c29271a481ef9ce7ce621b2a (diff)
ONOSFW-171
O/S-SFC-ONOS scenario documentation Change-Id: I51ae1cf736ea24ab6680f8edca1b2bf5dd598365 Signed-off-by: CNlucius <lukai1@huawei.com>
Diffstat (limited to 'framework/src/onos/web/gui/src/main/webapp/_bripc')
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.html58
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.js273
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons-test.js107
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons.html91
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.html89
-rw-r--r--framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.js170
6 files changed, 0 insertions, 788 deletions
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.html b/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.html
deleted file mode 100644
index 1912cc7e..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html>
-<!--
- ~ Copyright 2015 Open Networking Laboratory
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!--
- ONOS -- Displaying icons with Angular test page
- -->
-
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <title>Practice Table Formatting</title>
-
- <script type="text/javascript" src="../tp/angular.js"></script>
- <script type="text/javascript" src="../tp/angular-route.js"></script>
-
- <script type="text/javascript" src="../tp/d3.js"></script>
-
- <script type="text/javascript" src="practice-table.js"></script>
- <script type="text/javascript" src="../app/fw/widget/widget.js"></script>
- <script type="text/javascript" src="../app/fw/widget/table.js"></script>
-
- <style>
- html,
- body {
- background-color: #ddf;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 9pt;
- }
-
- h2 {
- color: darkred;
- }
-
- </style>
-
-</head>
-<!-- outline for using a controller in Angular -->
-<body ng-app="practiceTable">
- <h2>Scrolling Table Practice</h2>
- <div id="tableDiv" ng-controller="showTableCtrl as ctrl">
- </div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.js b/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.js
deleted file mode 100644
index f244c866..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/practice-table.js
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Showing Icons Test Module
- */
-
-(function () {
- 'use strict';
-
- var config = {
- colIds: ['_iconid_available', 'id', 'mfr', 'hw', 'sw', 'serial',
- 'annotations'],
- colText: ['Availability', 'URI', 'Vendor', 'Hardware Version',
- 'Software Version', 'Serial Number', 'Protocol']
- },
- deviceData = {
- "devices": [{
- "id": "of:0000000000000001",
- "available": true,
- "_iconid_available": "active",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000004",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- },
- {
- "id": "of:0000000000000092",
- "available": false,
- "_iconid_available": "inactive",
- "role": "MASTER",
- "mfr": "Nicira, Inc.",
- "hw": "Open vSwitch",
- "sw": "2.0.1",
- "serial": "None",
- "annotations": {
- "protocol": "OF_10"
- }
- }]
- };
-
- function setColWidth(t) {
- var tHeaders, tdElement, colWidth;
-
- tHeaders = t.selectAll('th');
-
- // select each td in the first row and set the header's width to the
- // corresponding td's width, if td is larger than header's width
- tHeaders.each(function(thElement, index){
- thElement = d3.select(this);
-
- tdElement = t.select('td:nth-of-type(' + (index + 1) + ')');
- colWidth = tdElement.style('width');
-
- thElement.style('width', colWidth);
- tdElement.style('width', colWidth);
- });
- }
-
- function setCSS(thead, tbody, height) {
- thead.style('display', 'block');
- tbody.style({'display': 'block',
- 'height': height || '100px',
- 'overflow': 'auto'
- });
- }
-
- function fixTable(t, th, tb, height) {
- setColWidth(t);
- setCSS(th, tb, height);
- }
-
- angular.module('practiceTable', ['onosWidget'])
-
- .controller('showTableCtrl', ['$log', '$scope', '$rootScope',
- '$timeout', 'TableService',
- function ($log, $scope, $rootScope, $timeout, ts) {
- var self = this;
- var table = ts.renderTable(d3.select('#tableDiv'), config, deviceData);
- }])
-
- .directive('fixedHeader', ['$log', '$timeout', '$compile',
- function ($log, $timeout, $compile) {
- return {
- restrict: 'A',
- scope: {
- tHeight: '@'
- },
-
- link: function (scope, element, attrs) {
- var table = d3.select(element[0]),
- thead = table.select('thead'),
- tbody = table.select('tbody');
-
- // wait until the table is visible
- scope.$watch(
- function () { return (!(table.offsetParent === null)); },
- function(newValue, oldValue) {
- if (newValue === true) {
-
- // ensure thead and tbody have no display
- thead.style('display', null);
- tbody.style('display', null);
-
- $timeout(function () {
- fixTable(table, thead, tbody, scope.tHeight);
- });
- }
- });
- }
- };
- }]);
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons-test.js b/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons-test.js
deleted file mode 100644
index 915e0168..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons-test.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2014,2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- Showing Icons Test Module
- */
-
-(function () {
- 'use strict';
-
- // assuming the glyph is a square
- // div is a D3 selection of the <DIV> element into which icon should load
- // size is the size of the glyph
- // id is the symbol id
- // rer is the rectangle the glyph will be in's rounded corners
- // svgClass is the class name for your glyph
- function createGlyph(div, size, id, rer, svgClass) {
- var dim = size || 20,
- texty = 30,
- gid = id || 'unknown',
- rx = rer || 4,
- svgCls = svgClass || 'embeddedGlyph',
- svg, g;
-
- svg = div.append('svg').attr({
- 'class': svgCls,
- width: dim,
- height: dim + texty,
- viewBox: '0 0 ' + dim + ' ' + dim
- });
-
- g = svg.append('g').attr({
- 'class': 'glyph'
- });
-
- g.append('rect').attr({
- width: dim,
- height: dim,
- rx: rx
- });
-
- g.append('use').attr({
- width: dim,
- height: dim,
- 'class': 'glyph',
- 'xlink:href': '#' + gid
- });
-
- g.append('text')
- .attr({
- 'text-anchor': 'left',
- y: '1em',
- x: 0,
- transform: 'translate(0, ' + dim + ')scale(0.8)'
- })
- .style('fill', '#800')
- .text(id);
- }
-
- angular.module('showIconsTest', ['onosSvg'])
-
- .controller('OvShowIconsTest', ['$log', 'GlyphService', 'IconService',
- function ($log, gs, icns) {
- var self = this;
-
- gs.init();
-
- var div = d3.select('#showIcons');
-
- // show device online and offline icons
- icns.loadEmbeddedIcon(div, 'active', 50);
- div.append('span').style('padding-left', '15px');
- icns.loadEmbeddedIcon(div, 'inactive', 50);
-
- var defs = d3.select('defs');
-
- // show all glyphs in glyph library
- gs.loadDefs(defs, null, true);
- var list = gs.ids(),
- gDiv = d3.select('#showGlyphs'),
- ctr = 0;
- list.forEach(function (id) {
- createGlyph(gDiv, 50, id);
- ctr += 1;
- if (ctr%6 > 0) {
- gDiv.append('span').style('padding-left', '15px');
- } else {
- gDiv.append('br');
- }
- });
-
- $log.log('OvShowIconsTest has been created');
- }]);
-}());
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons.html b/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons.html
deleted file mode 100644
index e6bf1dab..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/show-icons.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html>
-<!--
- ~ Copyright 2015 Open Networking Laboratory
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!--
- ONOS -- Displaying icons with Angular test page
- -->
-
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <title>Show Icons Angular</title>
-
- <script type="text/javascript" src="../tp/angular.js"></script>
- <script type="text/javascript" src="../tp/angular-route.js"></script>
-
- <script type="text/javascript" src="../tp/d3.js"></script>
-
- <script type="text/javascript" src="../app/fw/util/util.js"></script>
- <script type="text/javascript" src="../app/fw/util/fn.js"></script>
- <script type="text/javascript" src="../app/fw/util/theme.js"></script>
- <script type="text/javascript" src="../app/fw/util/keys.js"></script>
-
- <script type="text/javascript" src="../app/fw/svg/svg.js"></script>
- <script type="text/javascript" src="../app/fw/svg/svgUtil.js"></script>
- <script type="text/javascript" src="../app/fw/svg/glyph.js"></script>
- <script type="text/javascript" src="../app/fw/svg/icon.js"></script>
- <script type="text/javascript" src="../app/fw/svg/geodata.js"></script>
- <script type="text/javascript" src="../app/fw/svg/map.js"></script>
- <script type="text/javascript" src="../app/fw/svg/zoom.js"></script>
-
- <script type="text/javascript" src="show-icons-test.js"></script>
-
- <link rel="stylesheet" href="../app/common.css">
- <link rel="stylesheet" href="../app/fw/svg/icon.css">
-
- <style>
- html,
- body {
- background-color: #ddf;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 9pt;
- }
-
- h2 {
- color: darkred;
- }
-
- svg .glyph {
- stroke: none;
- fill: #123456;
- fill-rule: evenodd;
- }
-
- svg.embeddedGlyph .glyph rect {
- fill: #fff
- }
-
- </style>
-
-</head>
-<!-- outline for using a controller in Angular -->
-<body class="light" ng-app="showIconsTest" ng-controller="OvShowIconsTest as ctrl">
- <h2>Displaying Icons and Glyphs with Angular</h2>
- <div id="showIcons">
- <p>Show all icons in icon library:<br></p>
- </div>
- <hr>
- <div id="showGlyphs">
- <p>Show all glyphs in glyph library:</p>
- <p>(Displays checkMark and xMark too, because icons are built on top
- of glyphs.)</p>
- </div>
-
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.html b/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.html
deleted file mode 100644
index f9c11b8d..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html>
-<!--
- ~ Copyright 2015 Open Networking Laboratory
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!--
- ONOS -- SVG mouse over d3 exercise html
- -->
-
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <title>Upgrade Performance</title>
-
- <script type="text/javascript" src="../tp/angular.js"></script>
- <script type="text/javascript" src="../tp/d3.js"></script>
- <script type="text/javascript" src="svg-exercise.js"></script>
- <script type="text/javascript" src="../app/fw/util/util.js"></script>
- <script type="text/javascript" src="../app/fw/util/fn.js"></script>
-
-
- <style>
- html,
- body, div {
- background-color: #eee;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 9pt;
- margin: 0;
- overflow: hidden;
- }
- .button {
- fill: #369;
- filter: url(#buttonBevel);
- }
- svg text {
- fill: white;
- letter-spacing: .005em;
- }
- </style>
-</head>
-
-<body ng-app="svgExercise">
-
-<div id="svgExDiv" ng-controller="svgExCtrl as ctrl">
- <improve-performance></improve-performance>
-</div>
-
-<svg xmlns="http://www.w3.org/2000/svg"
- viewBox="-10 -10 110 110"
- visibility="hidden">
- <filter id="buttonBevel"
- filterUnits="objectBoundingBox"
- x="-10%" y="-10%" width="110%" height="110%">
- <feGaussianBlur in="SourceAlpha"
- stdDeviation="4"
- result="blur"/>
- <feSpecularLighting in="blur"
- surfaceScale="7"
- specularConstant="0.6"
- specularExponent="5"
- result="spec"
- lighting-color="#4E7199">
- <fePointLight x="-5000" y="-10000" z="20000"/>
- </feSpecularLighting>
- <feComposite in="spec"
- in2="SourceAlpha"
- operator="in"
- result="spec2"/>
- <feComposite in="SourceGraphic"
- in2="spec2"
- operator="arithmetic"
- k1="0" k2="1" k3="1" k4="0" />
- </filter>
-</svg>
-
-</body>
-</html>
diff --git a/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.js b/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.js
deleted file mode 100644
index 96ed131f..00000000
--- a/framework/src/onos/web/gui/src/main/webapp/_bripc/svg-exercise.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright 2015 Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- ONOS GUI -- SVG mouse over d3 exercise module
- */
-
-(function () {
- 'use strict';
-
- // injected references
- var $log, fs;
-
- // constants
- var btnWidth = 175,
- btnHeight = 50,
- hoverZone = 70,
- sectorDivisions = 3,
- margin = 10;
-
- // svg elements
- var svg, g;
-
- // other variables
- var winWidth, winHeight,
- sectorWidth, sectorHeight,
- currSector = 4, // always starts in the middle
- mouse;
-
- // ====================================================
-
- function centeredOnWindow(axis, dim) {
- return (axis / 2) - (dim / 2);
- }
-
- function onMouseMove() {
- mouse = d3.mouse(this);
- moveButton();
- }
-
- function removeMouseListener() {
- g.on('mousemove', null);
- }
-
- function addMouseListener() {
- g.on('mousemove', onMouseMove);
- }
-
- function selectSector() {
- var sector, row, col,
- currCol = currSector % sectorDivisions;
-
- do {
- sector = Math.floor((Math.random() * 9));
- col = sector % sectorDivisions;
- } while (col === currCol);
- currSector = sector;
- row = Math.floor(sector / sectorDivisions);
-
- return {
- xmin: (sectorWidth * col) + margin,
- xmax: ((sectorWidth * col) + sectorWidth) - margin,
- ymin: (sectorHeight * row) + margin,
- ymax: ((sectorHeight * row) + sectorHeight) - margin
- };
- }
-
- function selectXY(sectorCoords) {
- var x, y, x1, y1;
-
- do {
- x = (Math.random() * sectorCoords.xmax) + sectorCoords.xmin;
- y = (Math.random() * sectorCoords.ymax) + sectorCoords.ymin;
- x1 = x + btnWidth;
- y1 = y + btnHeight;
- } while (x1 > sectorCoords.xmax || y1 > sectorCoords.ymax);
-
- return {
- x: x,
- y: y
- };
- }
-
- function gTranslate(x, y) {
- return 'translate(' + x + ',' + y + ')';
- }
-
- function moveButton() {
- var sec = selectSector(),
- pos = selectXY(sec);
- g.transition()
- .duration(300)
- .ease('cubic-out')
- .each('start', removeMouseListener)
- .attr('transform', gTranslate(pos.x, pos.y))
- .each('end', addMouseListener);
- }
-
- angular.module('svgExercise', ['onosUtil'])
-
- .controller('svgExCtrl', ['$log', function (_$log_) {
- $log = _$log_;
- }])
-
- .directive('improvePerformance', ['FnService', function (_fs_) {
- fs = _fs_;
- return {
- restrict: 'E',
- link: function (scope, elem) {
- winWidth = fs.windowSize().width;
- winHeight = fs.windowSize().height;
- sectorWidth = winWidth / sectorDivisions;
- sectorHeight = winHeight / sectorDivisions;
-
- svg = d3.select(elem[0])
- .append('svg')
- .attr({
- width: winWidth + 'px',
- height: winHeight + 'px'
- });
-
- g = svg.append('g');
-
- g.append('rect')
- .attr({
- width: btnWidth + 'px',
- height: btnHeight + 'px',
- rx: '10px',
- 'class': 'button'
- });
-
- g.append('text')
- .style('text-anchor', 'middle')
- .text('Click for better performance.')
- .attr({
- x: btnWidth / 2,
- y: (btnHeight / 2) + 5
- });
-
- g.append('rect')
- .attr({
- fill: 'none',
- 'pointer-events': 'all',
- width: btnWidth + hoverZone + 'px',
- height: btnHeight + hoverZone + 'px',
- x: -(hoverZone / 2),
- y: -(hoverZone / 2)
- });
- g.attr('transform',
- gTranslate(centeredOnWindow(winWidth, btnWidth),
- centeredOnWindow(winHeight, btnHeight)));
-
- addMouseListener();
- }
- };
- }]);
-}()); \ No newline at end of file