svg

Python Svgwrite and font styles/ sizes

ぃ、小莉子 提交于 2021-02-18 06:58:11
问题 I'm trying to make a SVG file connected to a web scraper. How do I change font and text size with svgwrite? I understand that I have to define a CSS style and somehow connect that to the text object. But how is this made? Here's the code I have so far import svgwrite svg_document = svgwrite.Drawing(filename = "test-svgwrite3.svg", size = ("1200px", "800px")) #This is the line I'm stuck at #svg_document.add(svg_document.style('style="font-family: Arial; font-size : 34;')) svg_document.add(svg

Draw a D3 circle with gradient colours

旧时模样 提交于 2021-02-18 04:53:39
问题 How to draw a circle with gradient color? Say, a gradient from yellow to blue. Normally, to create a circle in yellow we can use the following code: var cdata=[50,40]; var xscale=40; var xspace =50; var yscale=70; var svg = d3.select("body") .append("svg") .attr("width", 1600) .attr("height", 1600); var circle = svg.selectAll("circle") .data(cdata) .enter() .append("circle"); var circleattr = circle .attr("cx", function(d) { xscale = xscale+xspace; return xscale; }) .attr("cy", function(d) {

Is WebGL or Canvas the only way to get SVG Keyframe Animations Hardware Accelerated?

岁酱吖の 提交于 2021-02-18 03:44:49
问题 What I'm looking is a flash alternative for mobile phones using html5. I was looking into SVG and it seems the only way to get hardware acceleration is to use CSS transforms on it. But CSS transforms aren't enough, I want to animate the actual nodes that make up a vector (ie, points on a path) so I could get more sophisticated character animation. To do this I was looking at some gui based editors. I checked what adobe has been up to and they seem to have killed Edge Animate and rebranded

Change SVG Viewbox size with CSS

梦想与她 提交于 2021-02-17 14:28:13
问题 The Question: Is there a way to change the size of the SVG viewbox with CSS, but preserve the aspect ratio? OR is there another way to preserve the aspect ratio of the SVG without a view box. The Problem: I want to responsively adjust the size of the SVG, but keep the aspect ratio. The width of the viewbox adjusts with the page, but the height doesn't adjust with the width. The problem with that is that the height of the container div is dependent on the height of the viewbox. So the

Place an object inside an SVG in javafx

隐身守侯 提交于 2021-02-17 07:15:06
问题 I am making Risk in java with javaFX. I have the map displayed in an fxml file, with every country having an SVGPath. I want to know how can I put a circle with a number inside it, in the centre of the SVG. I am hoping I can do this in the CSS but so far I cant get it working. My SVGPaths look like this: <SVGPath id="Egypt" styleClass="grey-country, africa, country" content="M484 328c8,2 15,10 23,9 0,-4 0,-4 1,-7 12,-3 24,4 35,8 5,0 9,0 14,0 1,5 3,10 4,15 -2,0 -4,-1 -6,-1 2,9 5,17 7,26 -3,1

Is it possible to add zoom and tooltip on the same line chart in d3js?

你离开我真会死。 提交于 2021-02-17 06:52:04
问题 Currently I am learning d3js, one of the feature i like to implement is showing tooltip and zooming horizontally. I figured out how to add zooming in the chart ( working fiddle) but feeling little complex in adding tooltip when hover over the points. Is it possible in d3js. Because when zooming we are adding rect element on the svg element. if we add the rect element in the chart means how to make this tooltip works. Need some help from d3 ninjas. var data = [{ date: "10:30:00", price: 36000

SVG line width issue

人走茶凉 提交于 2021-02-17 05:53:43
问题 I started my svg learning. And I want to do some skills bar with the svg line. But there is something I didn't understand. I create 2 lines per skills (one empty, and one with the percentage of knowledge). The problem is : The two first lines have half the height I give with stroke width. And the other lines have the good height... here is a jsbin : http://jsbin.com/lewimonize/edit?html,css,output Thanks in advance 回答1: Short answer: the line is clipped in half by the view box. When you draw

How to create a curve on the top of a background?

丶灬走出姿态 提交于 2021-02-17 03:27:39
问题 Please help me change the cutout from .top so that it is on top and not on the right. As shown in the image. Thank you very much in advance. I really hope for your help, I'm new to this business. Source code: Source code .box { margin-top:120px; width:200px; height:100px; background:white; } .box .top { height:100px; width:150px; transform:translateY(-100%); position:relative; background:#fff; } .top:before, .top:after{ content:""; position:absolute; top:0; width:50px; left:100%; bottom:50%;

Element created with createElementNS doesn't show

青春壹個敷衍的年華 提交于 2021-02-17 03:22:15
问题 I'm trying to create a new <img> with the <svg> tag with JavaScript every time I click on the button. When I see the result in the console firebug it works correctly, but nothing on screen displays. What I want is for an image <svg> to appear after the last one every time you click the button. Thanks in advance. var svgNS = "http://www.w3.org/2000/svg"; mybtn.addEventListener("click", createCircleSVG); function createCircleSVG(){ var d = document.createElement('svg'); d.setAttribute('id',

Applying a backdrop-filter: blur(); to an SVG path

Deadly 提交于 2021-02-17 02:48:05
问题 I am trying to recreate an effect in CSS using an SVG. We have text saved as an SVG and needing to blur the backdrop behind the text only. I know this is possible with block <div> elements by applying a css style of backdrop-filter: blur(10px); , but I am unable to get the same effect with SVG paths. This is the desired effect Here is a snippet of the SVG <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1040