Skip to content

Instantly share code, notes, and snippets.

View ChathuraGH's full-sized avatar
☺️
coding

Chathura madusanka ChathuraGH

☺️
coding
View GitHub Profile
@ChathuraGH
ChathuraGH / README.md
Created October 17, 2024 06:40 — forked from davelandry/README.md
SVG Text Wrapping

Using d3plus.textwrap, SVG <text> elements can be broken into separate <tspan> lines, as HTML does with <div> elements. In this example, the first column shows normal wrapped text, the second column shows text that is resized to fill the available space, and the third column shows the default SVG behavior.

D3plus automatically detects if there is a <rect> or <circle> element placed directly before the <text> container element in DOM, and uses that element's shape and dimensions to wrap the text. If it can't find one, or that behavior needs to be overridden, they can manually be specified using .shape( ), .width( ), and .height( ).

Featured on D3plus.org

To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:
#Real Cool Heading

The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #:
#real-cool-heading

Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses:
[Go to Real Cool Heading section](#real-cool-heading)

@ChathuraGH
ChathuraGH / magiczoomplus-video-gallery.html
Created December 30, 2023 12:03 — forked from Magic-Toolbox/magiczoomplus-video-gallery.html
Magic Zoom Plus gallery combined with YouTube and Vimeo videos
@ChathuraGH
ChathuraGH / gist:2e1b2c9f02390b1f85a4cd26768d26b8
Created August 5, 2021 03:38 — forked from schacon/gist:1
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.