GithubHelp home page GithubHelp logo

Not drawing out an SVG path about walkway HOT 7 CLOSED

donpinkus avatar donpinkus commented on June 10, 2024
Not drawing out an SVG path

from walkway.

Comments (7)

ConnorAtherton avatar ConnorAtherton commented on June 10, 2024 1

Great answer @jzjzjzj, thanks for getting here before I did. @donpinkus, here is the sass styles for the demo on my website.

  svg {
    path, line {
      stroke: #fff;
      stroke-width: 2px;
    }

    path {
      fill: transparent;
    }
  }

I think exporting from illustrator and thinking this is a bug may become common enough that I should add some information in the README about it. I'll do it later today.

from walkway.

jzjzjzj avatar jzjzjzj commented on June 10, 2024

It works on your example. Although maybe not as expected.
Simply add attributes stroke-width="3" stroke="#ff0000" to the path element to see the animation. You might want to increase duration as well (example).

I would suggest to split the path (example) since walkway uses total length of the path. This way though you need to set fill attributes explicitly (in callback to draw()?).

See my commit history for more info.

from walkway.

ConnorAtherton avatar ConnorAtherton commented on June 10, 2024

Just to demonstrate http://codepen.io/connoratherton/pen/ByBJxL

from walkway.

jzjzjzj avatar jzjzjzj commented on June 10, 2024

Problem with this splitting approach is we lose transparency on intersections of the compound path. Probably could be partially solved by using masks, but that would be completely different beast of SVG. And automating the splitting (if even possible) imho is out of the walkways scope.

from walkway.

donpinkus avatar donpinkus commented on June 10, 2024

Wow, thanks for the quick and thorough response guys!

It looks awesome after splitting the path.

Out of curiosity, how did you know where to split my path? I only have a bit of experience with SVG, mostly from D3. From looking at the path coordinates, I don't see obvious places where it's an inside path.

Also why the stroke-dasharray: 96.0715713500977px, 96.0715713500977px; stroke-dashoffset: 0px; line?

from walkway.

jzjzjzj avatar jzjzjzj commented on June 10, 2024

@donpinkus Where do you see stroke-dasharray: 96.0715713500977px, 96.0715713500977px; stroke-dashoffset: 0px;? You don't have to worry about it, those attributes are added and managed by the script.

Regards splitting - I have (had) no experience with SVG before reading your issue, but it is very suspicious that path of initial three examples starts with M and ends with z while containing neither of them inbetween. Except your example. Had to try splitting between z and M. :) My guess is that there should be a way of making a path to be not compound in Illustrator.

Anyway - more info.

from walkway.

ConnorAtherton avatar ConnorAtherton commented on June 10, 2024

Again, thanks @jzjzjzj, the link to the doc is fantastic. I'll close this in the next few hours.

from walkway.

Related Issues (20)

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.