Files
freeCodeCamp/curriculum/challenges/russian/04-data-visualization/data-visualization-with-d3/create-a-scatterplot-with-svg-circles.russian.md

84 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 587d7fab367417b2b2512bd7
title: Create a Scatterplot with SVG Circles
required:
- src: 'https://cdnjs.cloudflare.com/ajax/libs/d3/4.3.0/d3.min.js'
challengeType: 6
videoUrl: ''
localeTitle: Создайте Scatterplot с кругами SVG
---
## Description
<section id="description"> График рассеяния - это еще один вид визуализации. Он обычно использует круги для сопоставления точек данных, каждая из которых имеет по два значения. Эти значения привязываются к осям <code>x</code> и <code>y</code> и используются для позиционирования круга при визуализации. SVG имеет <code>circle</code> тег для создания формы круга. Он очень похож на элементы <code>rect</code> которые вы использовали для гистограммы. </section>
## Instructions
<section id="instructions"> Используйте методы <code>data()</code> , <code>enter()</code> и <code>append()</code> для привязки <code>dataset</code> к новым элементам <code>circle</code> , которые добавляются к холсту SVG. <strong>Заметка</strong> <br> Круги не будут видны, потому что мы еще не установили их атрибуты. Мы сделаем это в следующей задаче. </section>
## Tests
<section id='tests'>
```yml
tests:
- text: Ваш код должен содержать 10 элементов <code>circle</code> .
testString: 'assert($("circle").length == 10, "Your code should have 10 <code>circle</code> elements.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<body>
<script>
const dataset = [
[ 34, 78 ],
[ 109, 280 ],
[ 310, 120 ],
[ 79, 411 ],
[ 420, 220 ],
[ 233, 145 ],
[ 333, 96 ],
[ 222, 333 ],
[ 78, 320 ],
[ 21, 123 ]
];
const w = 500;
const h = 500;
const svg = d3.select("body")
.append("svg")
.attr("width", w)
.attr("height", h);
svg.selectAll("circle")
// Add your code below this line
// Add your code above this line
</script>
</body>
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>