svg

how to make the positions of lines in svg responsive

核能气质少年 提交于 2021-01-28 23:00:11
问题 I have a text and an image side by side with a little margin in the middle. I want to draw an arrow to a specific point on the image. So for this I trying to use svg however, the position of the line is somehow not responsive. After reading a couple of questions here (like this) and blog posts (like this) I changed all the values to % and also added the viewBox attribute But for some reason the arrow is only in the correct position with my current browser screen 1920x1200. If I resize the

how to make the positions of lines in svg responsive

不想你离开。 提交于 2021-01-28 22:50:30
问题 I have a text and an image side by side with a little margin in the middle. I want to draw an arrow to a specific point on the image. So for this I trying to use svg however, the position of the line is somehow not responsive. After reading a couple of questions here (like this) and blog posts (like this) I changed all the values to % and also added the viewBox attribute But for some reason the arrow is only in the correct position with my current browser screen 1920x1200. If I resize the

How to change CSS class to an <use> children inside a SVG?

安稳与你 提交于 2021-01-28 21:51:08
问题 I am making and animation the objetive is change the xlink:href inside a SVG. (this is for change a shape), and change class respect to their position inside. This is my SVG <svg viewBox="-20 -20 600 200" id="main"> <defs id="test"> <rect width="80" height="80" id="circle" fill="red" class="first" /> <rect width="80" height="80" id="square" fill="pink" class="second" /> <rect width="80" height="80" id="cross" fill="blue" class="third" /> </defs> <g id="load-area"> <use x="0" xlink:href="

Make HTML Canvas generate PDF-ready Line art?

眉间皱痕 提交于 2021-01-28 21:26:31
问题 I have an HTML/JavaScript program that uses the HTML5 canvas to generate a pretty graph: I want to include this graph in a book that I'm producing with LaTeX. Unfortunately, when I print this page to PDF, I get a bitmap—presumably because canvas is a bitmap. I just checked and apparently if I had developed this with SVG instead of with HTML5 canvas I would be good to go. But I didn't. So is there any way to generate line art from HTML5 Canvas, or should I just bite the bullet and re-implement

Create Tooltip for SVG <image> tag

流过昼夜 提交于 2021-01-28 20:07:20
问题 I am attempting to create a tooltip that will appear when the user hover overs the icon, the tootltip will give information regarding the event. The tag is within an SVG image. This is the code for the image: <image class="tooltip-trigger" data-tooltip-text="Battles" id="Battles" x="100" y="200" width="30" height="30" xlink:href="battle.png" /> <g id="tooltip" visibility="hidden" > <rect x="2" y="2" width="80" height="24" fill="black" opacity="0.4" rx="2" ry="2"/> <rect width="80" height="24"

getting the width and height of SVG element after skew transformation - javascript

吃可爱长大的小学妹 提交于 2021-01-28 19:53:55
问题 I have an SVG rect with the following atributes: <rect x="50" y="10" width="20" height="30" style="stroke: #000000; fill:none;" /> If I apply a skewX(10) tranformation, the width and height of the rectangle change. How do I then calculate its true width and height using plain javascript (without libraries)? 回答1: Wrap the <rect> in a <g> element; then get a reference to the group; then call getBBox() on it. var bbox = document.getElementById("wrapper").getBBox();; alert("width=" + bbox.width +

How to convert 10MB PDF to SVG quickly with appropriate size for web

╄→尐↘猪︶ㄣ 提交于 2021-01-28 19:08:39
问题 Good day, I have read all questions and answers about "PDF to SVG", "PDF to PNG, PNG to SVG" and had no success in accomplishing my task. I have a PDF that is about 10mb (blueprints from archiCAD) and after using pdf2svg to convert to SVG, the SVG is about 70mb. Conversion takes 14sec, but the web page load takes about 150sec because of the size of the SVG. My question is - how can i convert PDF in PHP to SVG with appropriate size for web without quality loss and without gzipping it? This

SVG filters: adjust color channels

老子叫甜甜 提交于 2021-01-28 12:12:24
问题 Looking to adjust the tonal values of the green color channel in an image. Specifically, changing the green values (only) to really dark green or black. Any ideas using svg filters? 回答1: You want the SVG feColorMatrix with type="matrix" . Then discard the Red/Blue channels, and multiply the green-to-green to be darker. Specifically, to turn an RGBA image to use just the green channel and darken it by half (and have full alpha no matter what the original alpha was), you want these matrix

SVG - How to apply a gradient transform matrix to a linear gradient brush?

独自空忆成欢 提交于 2021-01-28 12:09:11
问题 I'm writing a SVG viewer application in c++ language. I actually face a transform issue in several SVG files that I cannot figure out. Considering the following SVG file: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg id="svg9686" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="90mm" width="145mm" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:xlink="http:/

Why this SVG image from sprite-sheet is not getting rendered in HTML but not in React?

邮差的信 提交于 2021-01-28 11:19:27
问题 I have this code for SVG sprite <symbol xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" id="github"> <defs> <pattern id="a" preserveAspectRatio="none" width="100%" height="100%" viewBox="0 0 436 428"> <image width="436" height="428" xlink:href="data:image/png;base64,.........."></image> </pattern> </defs> <circle cx="11" cy="11" r="11" fill="#fff"></circle> <path fill="url(#a)" d="M0 0h22v22H0z"></path> </symbol> The GithHub icon is perfectly