Created with CodeSandbox
andreabarghigiani / odd-svg-path Goto Github PK
View Code? Open in Web Editor NEWCreated with CodeSandbox
Home Page: https://codesandbox.io/s/github/AndreaBarghigiani/testing-svg-path
Created with CodeSandbox
Home Page: https://codesandbox.io/s/github/AndreaBarghigiani/testing-svg-path
With a path defined as follows, we get the wrong values drawing the arcs.
const notPlayWellMiddleHorizontal = [
["h", 30],
["v", 10],
["H", 150],
["v", 5],
["H", 75],
["v", 15],
["H", "close"],
["v", 70],
["H", 250],
["v", -5],
["H", 375],
["v", 5],
["H", "start"],
["v", -30],
["H", -60],
["v", -35],
["H", "start"],
["v", -35],
];
As you can see from the image below the issue is present for the shape at the bottom and for the first two arcs that get's created while closing the shape.
Something here must be changed.
Transform the way we select the element to build the frame from so we can apply the frame to any elements on the page.
Right now the SVG is fixed but we need to change it in order to apply the custom frame.
Just pass a selector and let JavaScript calculate the size. Alternatively, since buildFrame()
accepts an SVG ID, we could traverse the DOM to find the sibling.
We want to animate the path after the page is load.
Set all the values of the array (including the arcRad
) and transition them from 0 to the original value. The only issue I can think of for now is that arcRad
needs to grow exponentially based on the space left, that's because if we have a radius bigger than the space browser does the best it can think of to still drawing the arc.
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.