Skip to content

Commit

Permalink
Add note about stoke and fill opacity in custom Path
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmobrunfeldt committed Mar 20, 2016
1 parent cb731ff commit 9b4fdf2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/api/path.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Custom shaped progress bar. You can create arbitrary shaped progress bars by
passing a SVG path created with e.g. Adobe Illustrator. It's on caller's responsibility to append SVG to DOM.

!!! note

Remember to add e.g. `stroke="1"` and `fill-opacity="0"` attributes for the SVG path.
They will reveal the true shape of the path.

**Example**

Assuming there was SVG object with heart shaped path in HTML
Expand All @@ -25,7 +30,10 @@ var path = new ProgressBar.Path(svgPath, {

**Working with embedded SVG**

If the SVG was not inline in the HTML but instead in, say, an `<object>` tag, we'd have to take extra steps to wait until it has loaded and then access it differently since it's in a separate DOM tree. Given e.g.:
If the SVG was not inline in the HTML but instead in, say,
an `<object>` tag, we'd have to take extra steps to wait until it has loaded
and then access it differently since it's in a separate DOM tree.
Given e.g.:

```html
<object id="heart" type="image/svg+xml" data="heart.svg">No SVG support :(</object>
Expand All @@ -43,7 +51,7 @@ var path = new ProgressBar.Path(heartObject.contentDocument.querySelector('#hear
**Parameters**
* `path` [SVG Path](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) object. For example `$('svg > path:first-child')[0]`.
* `path` [SVG Path](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) object or plain selector string. For example `$('svg > path:first-child')[0]`.
* `options` Animation options.
```javascript
Expand Down

0 comments on commit 9b4fdf2

Please sign in to comment.