Skip to main content

# Tag Info

## Hot answers tagged svg

10 votes
Accepted

### Draw sine wave going around a circle

Overall you have a good D3 code here, congrats (I'm fairly impressed with the questions I've seen here at CR lately, from people claiming "This is the very first time I've used d3 or drawn a SVG&...
• 1,456
7 votes
Accepted

### Visualization of the Pythagorean theorem

Wow! I’ve never reviewed an image before. Neat. First, I’d flip your left square to align the corners of the right-most triangles in the left square with the horizontal line in the right square. ...
• 33.7k
5 votes
Accepted

### d3.js canvas performance

Before anything else, the tutorial you're referencing is this: https://www.freecodecamp.org/news/d3-and-canvas-in-3-steps-8505c8b27444/ By reading the tutorial you'll see that the elements we'll ...
• 1,456
5 votes

### Shorten a SVG file created with Inkscape

SVG is written in XML. As a rule, you should prefer using proper XML tools to process XML rather than doing ad hoc text substitutions, for robustness and maintainability. Look into using XSL ...
• 144k
5 votes

### Soccer field map creator

That animations looks pretty cool. I'm no expert in OOP, but there is one thing I want to mention. This ...
• 1,124
4 votes

### Git Insert Delete Graph

Overview It is great that you: Used strict and warnings Leveraged other people's code by using the CPAN modules Used comments ...
• 3,661
4 votes

### Git Insert Delete Graph

A simple thing to add would be a Logarithmic Y-scaling function, so that significant bursts in either losses or gains don't get over-exaggerated perceptually. Essentially you want 100-commit days to ...
• 376
4 votes

### Plotting discontinous function

The problem of using D3 to plot a function is that you are using the wrong tool for the task. The explanation is simple: despite being a very powerful JS library, D3 is designed to create ...
• 1,456
4 votes

### Compress svg files in PHP

SVG is structured data and should therefore not require regex to work with it. I would suggest that you work with either an XML or SVG-specific library in PHP which would let you parse in the input ...
• 9,618
4 votes

### Shell function to convert .png to .svg file

You don’t need eval. For example, eval "rm \"\$pnm_filepath\"" is the same as ...
• 5,788
4 votes

### Draw sine wave going around a circle

Dry out, and separate style, data and logic. D3 seams to encourage a lot of repeated code with many lines of chained calls to .style and ...
• 22.1k
4 votes

### Draw sine wave going around a circle

Javascript Feedback Because the request is for "any way to make my code more concise" the feedback below focuses on simplifying the code while maintaining existing functionality. Constants It may ...
• 27.8k
3 votes

### PacMan in JavaScript and SVG

There will certainly be users that can review your javascript operations better than me, so I'll only review the php. When checking for the existence of substrings at the start of your input string, ...
• 8,674
3 votes

### Random Dice Simulation

This review comes with the caveat that I've spent a few days in total on Elm so far... Take anything I say with a pinch of salt. Firstly, some style things. ...
• 17k
3 votes
Accepted

### Python fractal tree using SVG

Interesting problem thanks for sharing. I have refactored your code and it is included in it entirety below. The most significant change made was to introduce a ...
• 4,216
2 votes
Accepted

### "Spinning wheels" - Animated spinner with SVG and Sass-CSS

I totaly refactored your code (CSS and HTML). I wont address all the modifications and focus on the main ones : Browser support The is an issue in firefox when a percentage ...
• 894
2 votes

### Using d3.drag() to enable dragging on an SVG group

Yes, there is a simpler way to achieve this: just use d3.event.x and d3.event.y, holding their values in the bound data. Thus, ...
• 1,456
2 votes
Accepted

### 2D colliding disks in JavaScript (ideal billiard balls)

Some issues and solutions: Using arrays for key-value data What does each element of one of the init_data mean? What is accessed by ...
• 136
2 votes
Accepted

### Small Javascript Lib to draw SVG file

General feedback For a beginner this looks quite thorough, though I did spot a couple places where improvements can be made. See the suggestions below. It is really tempting to suggest ecmascript-6 ...
• 27.8k
2 votes
Accepted

### Simplify SVG creation and manipulation using Proxy

General Feedback I can't claim to have done much with SVG creation myself but I can offer a few review points for the code that creates the SVG item. It looks like you have done a lot to abstract out ...
• 27.8k
1 vote
Accepted

### SVG hue navigation bar

For a simpler svg code, you can if you want to study this example that I created for you! It takes up your example of a bar with a straightforward linear gradient. As you can see you can change the ...
• 188
1 vote

### Soccer field map creator

OOP feedback The class only has two methods, and one isn't used (you even said so yourself: // not used yet, will be to reposition field). That ...
• 27.8k
1 vote
Accepted

### Simple chart class for SVG path generation

Repetition, similarities, and redundancies To simplify code you start by looking for repetition and similarities. In most cases you can remove the repeating/similar code by adding variables to take ...
• 22.1k
1 vote

### Loading an SVG into the canvas

wheel = (e) -> e = e or window.event # the code follows Here you want to set argument e to some default value if <...
• 1,785
1 vote

### SVG photo mosaic creator

My notes; getAverageRgb does not do what it says, it gets a context, this is bad drawMosiac <- spelling matters You should ...
• 33.2k
1 vote

### Render SVG background with Gradient

Well one improvement, aside from adding some ///Documenation is that using the following little function: ...
• 630

Only top scored, non community-wiki answers of a minimum length are eligible