alexandrebonaventure / vue-zdog Goto Github PK
View Code? Open in Web Editor NEWVue wrapper for zDog
Home Page: https://alexandrebonaventure.github.io/vue-zdog/
License: MIT License
Vue wrapper for zDog
Home Page: https://alexandrebonaventure.github.io/vue-zdog/
License: MIT License
Thanks Alexandre for this, declarative ZDog is awesome :)
Some shapes dont work, for example for ZPath or ZBox this error pops:
[Vue warn]: Error in created hook (Promise/async): "TypeError: Zdog[shapeName] is not a constructor"
You can reproduce here: https://codesandbox.io/s/vue-template-vjc7w
Some other shapes like ZCone seems to render the wrong shape.
Also the peer dependency vue-runtimes-helpers seems required.
To better contol the view of the result the default transforms of ZIllustraion should be exposed as props: https://zzz.dog/api#illustration-translate-rotate-scale
Having the constant exposed for easier rotation handling would be useful
An API for https://zzz.dog/api#group would be nice too!
ZCylinder does not render anything except, it seems, some very small strokes.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/zdog/dist/zdog.dist.min.js"></script>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<div id="app"></div>
<script type="text/javascript">
const { ZIllustration, ZCylinder } = VueZDog;
new Vue({
components: {
ZIllustration,
ZCylinder
},
render(h) {
const cyl = h(ZCylinder,{ props: {diameter: 500, length: 200, color: "#000", stroke: true}})
return h(ZIllustration, {
props: {
resize: 'fullscreen',
dragRotate: true
},
}, [cyl])
}
}).$mount('#app')
</script>
</body>
</html>
somehow dragRotate doesn't work for me.
it works, when I add it to your example on github like this:
return h(ZIllustration, {
props: {
zoom: 1.5,
resize: 'fullscreen',
dragRotate: true //here
},
staticClass: "w-100 h-100",
on: { tick: this.onTick }
}, [anchor])
but not when I do it like this in one of my .vue files
<ZIllustration :dragRotate="true"> <!--here-->
<ZShape :stroke="20" :path="[{x:-10},{x:10}]" />
</ZIllustration>
Am I doing something wrong or is this a bug?
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.