joeax / svidget Goto Github PK
View Code? Open in Web Editor NEWA JavaScript framework for building cool data visualization widgets in SVG.
License: MIT License
A JavaScript framework for building cool data visualization widgets in SVG.
License: MIT License
Hi, great work with the nest thermostat - thank you for this. I am wondering how to include this widget in my openhab / habpanel as an endpoint for receiving the data from the widget.
a small snippset showing how the habpanel code is handling the data - > example of simple 2 button arrows to increase and decrease the setpoint.
The question is:
1/ How to initiate the widget with values of target temp, and ambient from my system settings (data stored in items - to get the item value i need to point it in the html {{itemValue('RadiatorAC1_TargetTemperature')}}°C
2/ How to send the choosen target temperature to my item it's now done by 'ng-click="sendCmd('RadiatorAC1_TargetTemperature', itemValue('RadiatorAC1_TargetTemperature') ' directive
3/ is it possible to add a new funcionality which will allow me to choose the state of the thermostat off / on ? I don't know the nest thermostat behaviour but the widget seems to be imbossible to turn off. It should be possible to click somwhere to send it into away mode / off mode etc.
<div class="temperature-control">
<button class="arrow-button" ng-click="sendCmd('RadiatorAC1_TargetTemperature', itemValue('RadiatorAC1_TargetTemperature') * 1 - 0.5)">
<i class="fas fa-chevron-down"></i>
</button>
<div class="temperature-display">
{{itemValue('RadiatorAC1_TargetTemperature')}}°C
</div>
<button class="arrow-button" ng-click="sendCmd('RadiatorAC1_TargetTemperature', itemValue('RadiatorAC1_TargetTemperature') * 1 + 0.5)">
<i class="fas fa-chevron-up"></i>
</button>
</div>
Is it possible to use svidget's inside a svg document instead of a html document?
If I import the spinningStar example as an object in a bigger svg document, I get an iframe "spinningStar_frame" if I inspect the result, but no stars to be seen...
If i apply "display: none" (as a result of jQuery hide() method) on the DOM element, that contains widget, than after if i will apply "display: inline-block" on it (show()), the widget will be fully reloaded by chrome and his js part will be running again. It looks like all works (properties and actions), but events (in svidget terms) firing not working. In that time properties work as expected. It's looks like chrome fully destroy object's js context in svg when i set display: none on it and after show it again (with display: inline-block), because all global variables in svg js part at this moment has undefined type.
It's simply repeatable on http://www.svidget.com/examples/clock page, on dom element id="clockWidget"
Firefox just hide widget and all works as expected.
Hello! Help me please!
Is it possible to set binding to style property?
Example for Inkscape generated element:
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:type="arc"
style="fill:#aaff00;fill-opacity:1;stroke:#d3d3d3;stroke-width:0.99844074000000005;stroke-linejoin:miter;stroke-miterlimit:2.61313008999999985;stroke-opacity:1;stroke-dasharray:none"
id="led"
sodipodi:cx="27.237488"
sodipodi:cy="25.480864"
sodipodi:rx="12.859667"
sodipodi:ry="12.859667"
d="m 40.097155,25.480864 a 12.859667,12.859667 0 1 1 -25.719334,0 12.859667,12.859667 0 1 1 25.719334,0 z"
transform="matrix(1.1302449,0,0,1.1340118,-14.785032,-12.8956)" />
</g>
I want binding like this:
<svidget:param
name="ledColor"
shortname="color"
type="string"
subtype="color"
binding="#[email protected]" />
I would like to embed a svidget into an SVG. I was thinking along the lines of using the SVG < svg > tag or maybe even the < use > tag. Anyone tried this?
The reason for this is that I want to use the inkscape sprite-sheet as a way to store a bunch of svidgets and then use Inkscape to put them on my screen. This way I can use them in a way that is similar to using a movieclip in Flash.
(5h later... I found that Issue #2 is basically the same question...)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.