Giter Site home page Giter Site logo

odd-svg-path's Introduction

testing-svg-path

Created with CodeSandbox

odd-svg-path's People

Contributors

andreabarghigiani avatar

Stargazers

 avatar

Watchers

 avatar  avatar

odd-svg-path's Issues

Not right arc for absolute middle horizontal and vertical

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.
wrong-horizontal-arc

Something here must be changed.

Set dimensions on element

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.

Base idea

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.

Make path animatable

We want to animate the path after the page is load.

Base idea

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.