This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2015-2016, Salesforce.com, Inc. | ||
* All rights reserved. | ||
* Licensed under the MIT license. | ||
* For full license text, see LICENSE.md file in the repo root or | ||
* https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
'use strict'; | ||
|
||
let d3 = require('d3'); | ||
let View = function(controller, svg, module) { | ||
let model = module.env; | ||
svg = d3.select(svg) | ||
.classed('counter', true) | ||
.append('g'); | ||
let text = svg.append('text') | ||
.attr('x', 10) | ||
.attr('y', 20); | ||
|
||
return { | ||
name: 'CounterView', | ||
update: function(changes) { | ||
let output = ''; | ||
let counterVar = model.vars.get('counter'); | ||
if (counterVar !== undefined) { | ||
output = counterVar.toString(); | ||
} | ||
text.text(output); | ||
}, | ||
}; | ||
}; // View | ||
|
||
module.exports = View; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"main": { | ||
"name": "Counter", | ||
"spec": "counter.model", | ||
"view": "counter.jsx" | ||
"view": "counter.js" | ||
} | ||
} | ||
} |