fix(i18n): update Chinese translation of data visualization projects (#38864)

This commit is contained in:
ZhichengChen
2020-09-07 16:15:31 +08:00
committed by GitHub
parent 88ae7a5df8
commit 424cb619c1
5 changed files with 132 additions and 25 deletions

View File

@ -3,15 +3,36 @@ id: bd7168d8c242eddfaeb5bd13
title: Visualize Data with a Bar Chart
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 使用条形图可视化数据
forumTopicId: 301464
localeTitle: 用条形图可视化数据
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/GrZVaM" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/GrZVaM</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSS和基于D3 svg的可视化库。测试需要使用D3轴属性生成轴该属性会自动生成沿轴的刻度。通过D3测试需要这些刻度因为它们的位置用于确定绘制元素的对齐方式。有关生成轴的信息 <a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank"></a>访问<a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank">https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 。在每次测试时查询必需非虚拟DOM元素。如果您使用前端框架例如Vue则测试结果可能对动态内容不准确。我们希望最终能够容纳它们但D3项目目前不支持这些框架。 <strong>用户故事1</strong>我的图表应该有一个标题,对应的<code>id=&quot;title&quot;</code><strong>用户故事2</strong>我的图表应该有一个<code>g</code>元素x轴对应的<code>id=&quot;x-axis&quot;</code><strong>用户故事3</strong>我的图表应该有一个<code>g</code>元素y轴对应的<code>id=&quot;y-axis&quot;</code><strong>用户故事4</strong>两个轴应包含多个刻度标签,每个刻度标签对应的<code>class=&quot;tick&quot;</code><strong>用户故事5</strong>我的图表应该为每个数据点都有一个<code>rect</code>元素,相应的<code>class=&quot;bar&quot;</code>显示数据。 <strong>用户故事6</strong>每个栏应具有包含日期和GDP值的属性<code>data-date</code><code>data-gdp</code><strong>用户故事7</strong>条形元素的<code>data-date</code>属性应与提供的数据的顺序相匹配。 <strong>用户故事8</strong>条形元素的<code>data-gdp</code>属性应与提供的数据的顺序相匹配。 <strong>用户故事9</strong>每个条形元素的高度应准确地表示数据的相应GDP。 <strong>用户故事10</strong> <code>data-date</code>属性及其对应的bar元素应与x轴上的对应值对齐。 <strong>用户故事11</strong> <code>data-gdp</code>属性及其对应的bar元素应与y轴上的对应值对齐。 <strong>用户故事12</strong>我可以将鼠标悬停在一个区域上,并查看带有相应<code>id=&quot;tooltip&quot;</code> ,其中显示有关该区域的更多信息。 <strong>用户故事13</strong>我的工具提示应该有一个<code>data-date</code>属性,该属性对应于活动区域的<code>data-date</code> 。以下是完成此项目所需的数据集: <code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json</code> <a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">//raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json</a>您可以通过分叉<a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> 。完成后将URL提交到工作项目并传递所有测试。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
<section id='description'>
<strong>目标:</strong><a href='https://codepen.io' target='_blank'>CodePen.io</a> 上实现一个功能类似 <a href='https://codepen.io/freeCodeCamp/full/GrZVaM' target='_blank'>https://codepen.io/freeCodeCamp/full/GrZVaM</a> 的 App。
在满足以下<a href='https://en.wikipedia.org/wiki/User_story' target='_blank'>需求</a>并能通过所有测试的前提下,你可以根据自己的喜好来美化你的 app。
你可以使用 HTML、JavaScript、CSS、以及基于 svg 的 D3 可视化库来完成这个挑战。该任务需要使用 D3 的坐标轴属性生成坐标轴,这个属性会自动生成沿轴的刻度。这些刻度是通过 D3 测试所必需的,因为它们的位置是用来确定图表元素的对齐方式。你可以在这里 <a href='https://github.com/d3/d3/blob/master/API.md#axes-d3-axis' target='_blank'>https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 获取关于生成坐标轴的信息。每次测试查询的元素都必须是非虚拟 DOM。 如果你使用了前端框架(例如 Vue那么对于动态的内容测试结果可能不准确。我们希望最终能够兼容这些框架但 D3 项目目前还不支持它们。
<strong>需求 #1</strong>我的图表应该有一个具有<code>id="title"</code>属性的标题。
<strong>需求 #2</strong>我的图表应该有一个<code>g</code>元素作为 x 轴,并具有<code>id="x-axis"</code>属性。
<strong>需求 #3</strong>我的图表应该有一个<code>g</code>元素作为 y 轴,并具有<code>id="y-axis"</code>属性。
<strong>需求 #4</strong>两个轴都应包含多个刻度标签,每个标签具有<code>class="tick"</code>属性
<strong>需求 #5</strong>在我的图表里,每个数据点都应该有一个具有<code>class="bar"</code>属性的<code>rect</code>元素来展示数据。
<strong>需求 #6</strong>每一栏应该具有包含日期的<code>data-date</code>属性以及包含 GDP 值的<code>data-gdp</code>属性。
<strong>需求 #7</strong>条形元素的<code>data-date</code>属性应与提供的数据的顺序相匹配。
<strong>需求 #8</strong>条形元素的<code>data-gdp</code>属性应与提供的数据的顺序相匹配。
<strong>需求 #9</strong>每个条形元素的高度应准确地表示其数据所对应的 GDP 值。
<strong>需求 #10</strong><code>data-date</code>属性和它对应的条形元素应与 x 轴上的相应的值对齐。
<strong>需求 #11</strong><code>data-gdp</code>属性和它对应的条形元素应与 y 轴上的相应的值对齐。
<strong>需求 #12</strong>我可以将鼠标悬停在某个区域上,并查看具有<code>id="tooltip"</code>属性的提示框,它会显示有关该区域的更多信息。
<strong>需求 #13</strong>我的提示框应该有一个<code>data-date</code>属性,它对应了当前激活区域的<code>data-date</code>属性。
以下是完成此项目所需的数据:<code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/GDP-data.json</code>
你可以 fork <a href='https://codepen.io/freeCodeCamp/pen/MJjpwO' target='_blank'>这个 CodePen pen 项目</a>来构建你的项目。或者你可以在任何你喜欢的环境中使用以下 CDN 链接来运行测试:<code>https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js</code>.
一旦你完成了本项目并且该项目所有测试运行通过,请提交项目的 URL。
</section>
## Instructions
<section id="instructions">
<section id='instructions'>
</section>
## Tests
@ -36,4 +57,4 @@ tests: []
// solution required
```
/section>
</section>

View File

@ -3,15 +3,34 @@ id: 587d7fa6367417b2b2512bbf
title: Visualize Data with a Choropleth Map
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 使用等值线图可视化数据
forumTopicId: 301465
localeTitle: 用地区分布图可视化数据
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/EZKqza" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/EZKqza</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSS和基于D3 svg的可视化库。在每次测试时查询必需非虚拟DOM元素。如果您使用前端框架例如Vue则测试结果可能对动态内容不准确。我们希望最终能够容纳它们但D3项目目前不支持这些框架。 <strong>用户故事1</strong>我的等值应该有一个带有相应<code>id=&quot;title&quot;</code><strong>用户故事2</strong>我的等值应该有一个带有相应<code>id=&quot;description&quot;</code>的描述元素。 <strong>用户故事3</strong>我的等值应该有具有代表数据的相应<code>class=&quot;county&quot;</code><strong>用户故事4</strong>县应该至少使用4种不同的填充颜色。 <strong>用户故事5</strong>我的县应该拥有包含相应的fips和教育价值的<code>data-fips</code><code>data-education</code>属性。 <strong>用户故事6</strong>我的等值应该为每个提供的数据点设置一个县。 <strong>用户故事7</strong>县应具有与样本数据匹配的数据fips和数据教育值。 <strong>用户故事8</strong>我的等值应该有一个带有相应<code>id=&quot;legend&quot;</code><strong>用户故事9</strong>图例应至少使用4种不同的填充颜色。 <strong>用户故事10</strong>我可以将鼠标悬停在某个区域上,并查看带有相应<code>id=&quot;tooltip&quot;</code> ,其中显示有关该区域的更多信息。 <strong>用户故事11</strong>我的工具提示应该具有与活动区域的<code>data-education</code>相对应的<code>data-education</code>属性。以下是完成此项目所需的数据集: <br><ul><li> <strong>美国教育数据:</strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/choropleth_map/for_user_education.json</code> <strong></strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/choropleth_map/for_user_education.json</code> </li><li> <strong>美国县数据:</strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/choropleth_map/counties.json</code> <strong></strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/choropleth_map/counties.json</code> </li></ul>您可以通过分叉<a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后将URL提交给您的工作通过所有测试的项目。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
<section id='description'>
<strong>目标:</strong><a href='https://codepen.io' target='_blank'>CodePen.io</a> 上实现一个功能类似 <a href='https://codepen.io/freeCodeCamp/full/EZKqza' target='_blank'>https://codepen.io/freeCodeCamp/full/EZKqza</a> 的 App。
在满足以下<a href='https://en.wikipedia.org/wiki/User_story' target='_blank'>需求</a>并能通过所有测试的前提下,你可以根据自己的喜好来美化你的 app。
你可以使用 HTML、JavaScript、CSS、以及基于 svg 的 D3 可视化库来完成这个挑战。该任务需要使用 D3 的坐标轴属性生成坐标轴,这个属性会自动生成沿轴的刻度。这些刻度是通过 D3 测试所必需的,因为它们的位置是用来确定图表元素的对齐方式。你可以在这里 <a href='https://github.com/d3/d3/blob/master/API.md#axes-d3-axis' target='_blank'>https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 获取关于生成坐标轴的信息。每次测试查询的元素都必须是非虚拟 DOM。 如果你使用了前端框架(例如 Vue那么对于动态的内容测试结果可能不准确。我们希望最终能够兼容这些框架但 D3 项目目前还不支持它们。
<strong>需求 #1</strong>我的地区分布图应该有一个具有<code>id="title"</code>属性的标题。
<strong>需求 #2</strong>我的地区分布图应该有一个具有<code>id="description"</code>属性的描述内容。
<strong>需求 #3</strong>我的地区分布图应该有一些州县来展示数据,这些州县应该具有<code>class="county"</code>属性。
<strong>需求 #4</strong>这些州县至少应该有 4 种不同的填充颜色。
<strong>需求 #5</strong>我的每个州县都应该具有<code>data-fips</code><code>data-education</code>属性,分别包含他们相应的 fips 值和教育值。
<strong>需求 #6</strong>在我的地区分布图中,每一个提供的数据点都应该有一个对应的州县。
<strong>需求 #7</strong>各个州县应该具有与样本数据匹配的 fips 值和教育值。
<strong>需求 #8</strong>我的地区分布图应该有一个具有<code>id="legend"</code>属性的图例。
<strong>需求 #9</strong>这些图例至少应该使用 4 种不同的填充颜色。
<strong>需求 #10</strong>我可以将鼠标悬停在某个区域上,并查看具有<code>id="tooltip"</code>属性的提示框,它会显示有关该区域的更多信息。
<strong>需求 #11</strong>我的提示框应该有一个<code>data-education</code>属性它对应了当前激活区域的code>data-education</code>属性。
以下是完成此项目所需的数据集:<br><ul><li><strong>US Education Data: </strong><code>https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/for_user_education.json</code></li><li><strong>US County Data: </strong><code>https://raw.githubusercontent.com/no-stack-dub-sack/testable-projects-fcc/master/src/data/choropleth_map/counties.json</code></li></ul>
你可以 fork <a href='https://codepen.io/freeCodeCamp/pen/MJjpwO' target='_blank'>这个 CodePen pen 项目</a>来构建你的项目。或者你可以在任何你喜欢的环境中使用以下 CDN 链接来运行测试:<code>https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js</code>.
一旦你完成了本项目并且该项目所有测试运行通过,请提交项目的 URL。
</section>
## Instructions
<section id="instructions">
<section id='instructions'>
</section>
## Tests
@ -36,4 +55,4 @@ tests: []
// solution required
```
/section>
</section>

View File

@ -3,15 +3,40 @@ id: bd7188d8c242eddfaeb5bd13
title: Visualize Data with a Heat Map
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 使用热图可视化数据
forumTopicId: 301466
localeTitle: 用热图可视化数据
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/JEXgeY" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/JEXgeY</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSS和基于D3 svg的可视化库。在每次测试时查询必需非虚拟DOM元素。如果您使用前端框架例如Vue则测试结果可能对动态内容不准确。我们希望最终能够容纳它们但D3项目目前不支持这些框架。 <strong>用户故事1</strong>我的热图应该有一个标题,对应的<code>id=&quot;title&quot;</code><strong>用户故事2</strong>我的热图应该有一个相应的<code>id=&quot;description&quot;</code><strong>用户故事3</strong>我的热图应该有一个x轴对应的<code>id=&quot;x-axis&quot;</code><strong>用户故事4</strong>我的热图应该有一个y轴对应的<code>id=&quot;y-axis&quot;</code><strong>用户故事5</strong>我的热图应该有一个<code>rect</code>元素,其中<code>class=&quot;cell&quot;</code>代表数据。 <strong>用户故事6</strong>细胞应至少使用4种不同的填充颜色。 <strong>用户故事7</strong>每个单元格将包含属性<code>data-month</code> <code>data-year</code> <code>data-temp</code>其中包含相应的月,年和温度值。 <strong>用户故事8</strong>每个单元格的<code>data-month</code> <code>data-year</code>应在数据范围内。 <strong>用户故事9</strong>我的热图应该具有与y轴上相应月份对齐的单元格。 <strong>用户故事10</strong>我的热图应该具有与x轴上相应年份对齐的单元格。 <strong>用户故事11</strong>我的热图在y轴上应该有多个刻度标签并带有完整的月份名称。 <strong>用户故事12</strong>我的热图应该在x轴上有多个刻度标签年份在1754到2015之间。 <strong>用户故事13</strong>我的热图应该有一个带有相应<code>id=&quot;legend&quot;</code><strong>用户故事14</strong>我的图例应该包含<code>rect</code>元素。 <strong>用户故事15</strong>图例中的<code>rect</code>元素应使用至少4种不同的填充颜色。 <strong>用户故事16</strong>我可以将鼠标悬停在某个区域上,并查看带有相应<code>id=&quot;tooltip&quot;</code>的工具提示,该<code>id=&quot;tooltip&quot;</code>会显示有关该区域的更多信息。 <strong>用户故事16</strong>我的工具提示应该有一个<code>data-year</code>属性,该属性对应于活动区域的<code>data-year</code> 。以下是完成此项目所需的数据集: <code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/global-temperature.json</code> <a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">//raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/global-temperature.json</a>您可以通过分叉<a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后将URL提交给您的工作通过所有测试的项目。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
<section id='description'>
<strong>目标:</strong><a href='https://codepen.io' target='_blank'>CodePen.io</a> 上实现一个功能类似 <a href='https://codepen.io/freeCodeCamp/full/JEXgeY' target='_blank'>https://codepen.io/freeCodeCamp/full/JEXgeY</a> 的 App。
在满足以下<a href='https://en.wikipedia.org/wiki/User_story' target='_blank'>需求</a>并能通过所有测试的前提下,你可以根据自己的喜好来美化你的 app。
你可以使用 HTML、JavaScript、CSS、以及基于 svg 的 D3 可视化库来完成这个挑战。该任务需要使用 D3 的坐标轴属性生成坐标轴,这个属性会自动生成沿轴的刻度。这些刻度是通过 D3 测试所必需的,因为它们的位置是用来确定图表元素的对齐方式。你可以在这里 <a href='https://github.com/d3/d3/blob/master/API.md#axes-d3-axis' target='_blank'>https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 获取关于生成坐标轴的信息。每次测试查询的元素都必须是非虚拟 DOM。 如果你使用了前端框架(例如 Vue那么对于动态的内容测试结果可能不准确。我们希望最终能够兼容这些框架但 D3 项目目前还不支持它们。
<strong>需求 #1</strong>我的热度图应该有一个具有<code>id="title"</code>属性的标题。
<strong>需求 #2</strong>我的热度图应该有一个具有<code>id="title"</code>属性的描述内容。
<strong>需求 #3</strong>我的热度图应该有一个具有<code>id="x-axis"</code>属性的 x 轴。
<strong>需求 #4</strong>我的热度图应该有一个具有<code>id="y-axis"</code>属性的 y 轴。
<strong>需求 #5</strong>我的热度图应该有一些<code>rect</code>元素来展示数据,他们具有<code>class="cell"</code>属性。
<strong>需求 #6</strong>这些单元格元素至少应该有 4 种不同的填充颜色。
<strong>需求 #7</strong>每个单元格元素都有这些属性<code>data-month</code><code>data-year</code><code>data-temp</code>,包含了它们相应的月份,年份和温度值。
<strong>需求 #8</strong>每个元素的<code>data-month</code><code>data-year</code>属性应该在数据范围内。
<strong>需求 #9</strong>我的热度图应该具有与 y 轴上的相应月份对齐的单元格。
<strong>需求 #10</strong>我的热度图应该具有与 x 轴上相应年份对齐的单元格。
<strong>需求 #11</strong>我的热度图应该在 y 轴上有多个刻度标签,并带有完整的月份名称。
<strong>需求 #12</strong>我的热度图应该在 x 轴上有多个刻度标签,年份在 1754 到 2015 之间。
<strong>需求 #13</strong>我的热度图应该有一个具有<code>id="legend"</code>属性的图例。
<strong>需求 #14</strong>我的图例应该包含一些<code>rect</code>元素。
<strong>需求 #15</strong>图例中的这些<code>rect</code>元素应该至少使用 4 种不同的填充颜色。
<strong>需求 #16</strong>我可以将鼠标悬停在某个区域上,并查看具有<code>id="tooltip"</code>属性的提示框,它会显示有关该区域的更多信息。
<strong>需求 #17</strong>我的提示框应该有一个<code>data-year</code>属性,它对应了当前激活区域的<code>data-year</code>属性。
以下是完成此项目所需的数据:<code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/global-temperature.json</code>
你可以 fork <a href='https://codepen.io/freeCodeCamp/pen/MJjpwO' target='_blank'>这个 CodePen pen 项目</a>来构建你的项目。或者你可以在任何你喜欢的环境中使用以下 CDN 链接来运行测试:<code>https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js</code>.
一旦你完成了本项目并且该项目所有测试运行通过,请提交项目的 URL。
</section>
## Instructions
<section id="instructions">
<section id='instructions'>
</section>
## Tests
@ -36,4 +61,4 @@ tests: []
// solution required
```
/section>
</section>

View File

@ -3,15 +3,38 @@ id: bd7178d8c242eddfaeb5bd13
title: Visualize Data with a Scatterplot Graph
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 使用散点图可视化数据
forumTopicId: 301467
localeTitle: 用散点图可视化数据
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/bgpXyK" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/bgpXyK</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSS和基于D3 svg的可视化库。测试需要使用D3轴属性生成轴该属性会自动生成沿轴的刻度。通过D3测试需要这些刻度因为它们的位置用于确定绘制元素的对齐方式。有关生成轴的信息 <a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank"></a>访问<a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank">https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 。在每次测试时查询必需非虚拟DOM元素。如果您使用前端框架例如Vue则测试结果可能对动态内容不准确。我们希望最终能够容纳它们但D3项目目前不支持这些框架。 <strong>用户故事1</strong>我可以看到一个具有相应<code>id=&quot;title&quot;</code>的title元素。 <strong>用户故事2</strong>我可以看到一个x轴其对应的<code>id=&quot;x-axis&quot;</code><strong>用户故事3</strong>我可以看到一个y轴它具有相应的<code>id=&quot;y-axis&quot;</code><strong>用户故事4</strong>我可以看到点,每个点都有一个<code>dot</code> ,表示正在绘制的数据。 <strong>用户故事5</strong>每个点应具有包含其对应的x和y值的属性<code>data-xvalue</code><code>data-yvalue</code><strong>用户故事6</strong>每个点的<code>data-xvalue</code><code>data-yvalue</code>应该在实际数据的范围内,并且应该是正确的数据格式。对于<code>data-xvalue</code> 可以接受整数全年或Date对象进行测试评估。对于<code>data-yvalue</code> 分钟请使用Date对象。 <strong>用户故事7</strong> <code>data-xvalue</code>及其对应的点应与x轴上的对应点/值对齐。 <strong>用户故事8</strong> <code>data-yvalue</code>及其对应的点应与y轴上的对应点/值对齐。 <strong>用户故事9</strong>我可以在y轴上看到多个刻度标签其中<code>%M:%S</code>时间格式。 <strong>用户故事10</strong>我可以在x轴上看到显示年份的多个刻度标签。 <strong>用户故事11</strong>我可以看到x轴标签的范围在实际的x轴数据范围内。 <strong>用户故事12</strong>我可以看到y轴标签的范围在实际y轴数据的范围内。 <strong>用户故事13</strong>我可以看到包含<code>id=&quot;legend&quot;</code>描述性文本的<code>id=&quot;legend&quot;</code><strong>用户故事14</strong>我可以将鼠标悬停在一个区域上,并查看带有相应<code>id=&quot;tooltip&quot;</code> ,其中显示有关该区域的更多信息。 <strong>用户故事15</strong>我的工具提示应该有一个<code>data-year</code>属性,该属性对应于活动区域的<code>data-xvalue</code> 。以下是完成此项目所需的数据集: <code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/cyclist-data.json</code> <a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">//raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/cyclist-data.json</a>您可以通过分叉<a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后将URL提交给您的工作通过所有测试的项目。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
<section id='description'>
<strong>目标:</strong><a href='https://codepen.io' target='_blank'>CodePen.io</a> 上实现一个功能类似 <a href='https://codepen.io/freeCodeCamp/full/bgpXyK' target='_blank'>https://codepen.io/freeCodeCamp/full/bgpXyK</a> 的 App。
在满足以下<a href='https://en.wikipedia.org/wiki/User_story' target='_blank'>需求</a>并能通过所有测试的前提下,你可以根据自己的喜好来美化你的 app。
你可以使用 HTML、JavaScript、CSS、以及基于 svg 的 D3 可视化库来完成这个挑战。该任务需要使用 D3 的坐标轴属性生成坐标轴,这个属性会自动生成沿轴的刻度。这些刻度是通过 D3 测试所必需的,因为它们的位置是用来确定图表元素的对齐方式。你可以在这里 <a href='https://github.com/d3/d3/blob/master/API.md#axes-d3-axis' target='_blank'>https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 获取关于生成坐标轴的信息。每次测试查询的元素都必须是非虚拟 DOM。 如果你使用了前端框架(例如 Vue那么对于动态的内容测试结果可能不准确。我们希望最终能够兼容这些框架但 D3 项目目前还不支持它们。
<strong>需求 #1</strong>我能看到一个具有<code>id="title"</code>属性的标题元素。
<strong>需求 #2</strong>我能看到一个具有<code>id="x-axis"</code>属性的 x 轴。
<strong>需求 #3</strong>我能看到一个具有<code>id="y-axis"</code>属性的 y 轴。
<strong>需求 #4</strong>我可以看到一些点,每个点都有一个值为<code>dot</code>的 class 属性,它代表了被绘制的数据。
<strong>需求 #5</strong>每个点都应具有<code>data-xvalue</code>属性和<code>data-yvalue</code>属性,其中包含相应的 x 和 y 值。
<strong>需求 #6</strong>每个点的<code>data-xvalue</code>属性和<code>data-yvalue</code>属性应该在实际数据的范围内,并且数据格式应该正确无误。对于<code>data-xvalue</code>属性,可以接受整数(全年)或 Date 对象进行测试评估。对于<code>data-yvalue</code>属性(分钟),请使用 Date 对象。
<strong>需求 #7</strong><code>data-xvalue</code>属性和它对应的点应该和 x 轴上的点或值对齐。
<strong>需求 #8</strong><code>data-yvalue</code>属性和它对应的点应该和 y 轴上的点或值对齐。
<strong>需求 #9</strong>我可以在 y 轴上看到多个时间格式为<code>%M:%S</code>的刻度标签。
<strong>需求 #10</strong>我可以在 x 轴上看到显示年份的多个刻度标签。
<strong>需求 #11</strong>我可以看到 x 轴标签的范围在实际 x 轴数据的范围内。
<strong>需求 #12</strong>我可以看到 y 轴标签的范围在实际 y 轴数据的范围内。
<strong>需求 #13</strong>我可以看到一个包含描述性文字的图例,它具有<code>id="legend"</code>属性。
<strong>需求 #14</strong>我可以将鼠标悬停在某个区域上,并查看具有<code>id="tooltip"</code>属性的提示框,它会显示有关该区域的更多信息。
<strong>需求 #15</strong>我的提示框应该有一个<code>data-year</code>属性,它对应了当前激活区域的<code>data-xvalue</code>属性。
以下是完成此项目所需的数据:<code>https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/cyclist-data.json</code>
你可以 fork <a href='https://codepen.io/freeCodeCamp/pen/MJjpwO' target='_blank'>这个 CodePen pen 项目</a>来构建你的项目。或者你可以在任何你喜欢的环境中使用以下 CDN 链接来运行测试:<code>https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js</code>.
一旦你完成了本项目并且该项目所有测试运行通过,请提交项目的 URL。
</section>
## Instructions
<section id="instructions">
<section id='instructions'>
</section>
## Tests
@ -36,4 +59,4 @@ tests: []
// solution required
```
/section>
</section>

View File

@ -3,15 +3,34 @@ id: 587d7fa6367417b2b2512bc0
title: Visualize Data with a Treemap Diagram
isRequired: true
challengeType: 3
videoUrl: ''
localeTitle: 使用树形图可视化数据
forumTopicId: 301468
localeTitle: 用树形图可视化数据
---
## Description
<section id="description"> <strong>目标:</strong>构建一个功能类似于此的<a href="https://codepen.io" target="_blank">CodePen.io</a>应用程序: <a href="https://codepen.io/freeCodeCamp/full/KaNGNR" target="_blank">https</a> <strong></strong> <a href="https://codepen.io" target="_blank">//codepen.io/freeCodeCamp/full/KaNGNR</a> 。完成以下<a href="https://en.wikipedia.org/wiki/User_story" target="_blank">用户故事</a>并通过所有测试。给它你自己的个人风格。您可以使用HTMLJavaScriptCSS和基于D3 svg的可视化库。测试需要使用D3轴属性生成轴该属性会自动生成沿轴的刻度。通过D3测试需要这些刻度因为它们的位置用于确定绘制元素的对齐方式。有关生成轴的信息 <a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank"></a>访问<a href="https://github.com/d3/d3/blob/master/API.md#axes-d3-axis" target="_blank">https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 。在每次测试时查询必需非虚拟DOM元素。如果您使用前端框架例如Vue则测试结果可能对动态内容不准确。我们希望最终能够容纳它们但D3项目目前不支持这些框架。 <strong>用户故事1</strong>我的树图应该有一个标题,对应的<code>id=&quot;title&quot;</code><strong>用户故事2</strong>我的树图应该有一个对应<code>id=&quot;description&quot;</code><strong>用户故事3</strong>我的树形图应该有一个<code>rect</code>元素,并且对应的<code>class=&quot;tile&quot;</code>代表数据。 <strong>用户故事4</strong>瓷砖应至少有2种不同的填充颜色。 <strong>用户故事5</strong>每个瓷砖应具有属性<code>data-name</code> <code>data-category</code> ,和<code>data-value</code>包含其相应的名称,类别,和值。 <strong>用户故事6</strong>每个图块的区域应对应于数据值量:具有较大数据值的图块应具有更大的区域。 <strong>用户故事7</strong>我的树形图应该有一个对应<code>id=&quot;legend&quot;</code><strong>用户故事8</strong>我的图例应该有一个带有相应<code>class=&quot;legend-item&quot;</code> <code>rect</code>元素。 <strong>用户故事9</strong>图例中的<code>rect</code>元素应使用至少2种不同的填充颜色。 <strong>用户故事10</strong>我可以将鼠标悬停在某个区域上,并查看带有相应<code>id=&quot;tooltip&quot;</code> ,其中显示有关该区域的更多信息。 <strong>用户故事11</strong>我的工具提示应具有与活动区域的<code>data-value</code>对应的<code>data-value</code> <code>data-value</code>属性。对于此项目,您可以使用以下任何数据集: <br><ul><li> <strong>Kickstarter承诺</strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/kickstarter-funding-data.json</code> <strong></strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/kickstarter-funding-data.json</code> </li><li> <strong>电影销售:</strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/movie-data.json</code> <strong></strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/movie-data.json</code> </li><li> <strong>视频游戏销售:</strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/video-game-sales-data.json</code> <strong></strong> <code>https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/video-game-sales-data.json</code> </li></ul>您可以通过分叉<a href="https://codepen.io/freeCodeCamp/pen/MJjpwO" target="_blank">此CodePen笔</a>来构建项目。或者您可以使用此CDN链接在您喜欢的任何环境中运行测试 <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code> <code>https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js</code>完成后将URL提交给您的工作通过所有测试的项目。如果卡住请记住使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a>方法。 </section>
<section id='description'>
<strong>目标:</strong><a href='https://codepen.io' target='_blank'>CodePen.io</a> 上实现一个功能类似 <a href='https://codepen.io/freeCodeCamp/full/KaNGNR' target='_blank'>https://codepen.io/freeCodeCamp/full/KaNGNR</a> 的 App。
在满足以下<a href='https://en.wikipedia.org/wiki/User_story' target='_blank'>需求</a>并能通过所有测试的前提下,你可以根据自己的喜好来美化你的 app。
你可以使用 HTML、JavaScript、CSS、以及基于 svg 的 D3 可视化库来完成这个挑战。该任务需要使用 D3 的坐标轴属性生成坐标轴,这个属性会自动生成沿轴的刻度。这些刻度是通过 D3 测试所必需的,因为它们的位置是用来确定图表元素的对齐方式。你可以在这里 <a href='https://github.com/d3/d3/blob/master/API.md#axes-d3-axis' target='_blank'>https://github.com/d3/d3/blob/master/API.md#axes-d3-axis</a> 获取关于生成坐标轴的信息。每次测试查询的元素都必须是非虚拟 DOM。 如果你使用了前端框架(例如 Vue那么对于动态的内容测试结果可能不准确。我们希望最终能够兼容这些框架但 D3 项目目前还不支持它们。
<strong>需求 #1</strong>我的矩阵树图应该有一个具有<code>id="title"</code>属性的标题。
<strong>需求 #2</strong>我的矩阵树图应该有一个具有<code>id="description"</code>属性的描述内容。
<strong>需求 #3</strong>我的矩阵树图应该有一些具有<code>class="tile"</code>属性的<code>rect</code>元素来展示数据。
<strong>需求 #4</strong>这些矩形块元素至少应该有 2 种不同的填充颜色。
<strong>需求 #5</strong>每一块矩形元素应该具有<code>data-name</code><code>data-category</code>,以及<code>data-value</code>这些属性,包含了它们相应的名称,分类,以及数值。
<strong>需求 #6</strong>每个矩形块的面积和它的 data-value 属性值相对应data-value 值越大的矩形块面积越大。
<strong>需求 #7</strong>我的矩阵树图应该有一个具有<code>id="legend"</code>属性的图例。
<strong>需求 #8</strong>我的图例应该有一些具有<code>class="legend-item"</code>属性的<code>rect</code>元素。
<strong>需求 #9</strong>图例中的这些<code>rect</code>元素至少应该使用 2 种不同的填充颜色。
<strong>需求 #10</strong>我可以将鼠标悬停在某个区域上,并查看具有<code>id="tooltip"</code>属性的提示框,它会显示有关该区域的更多信息。
<strong>需求 #11</strong>我的提示框应该有一个<code>data-value</code>属性它对应了当前激活区域的code>data-value</code>属性。
对于此项目,您可以使用以下任何数据集:<br><ul><li><strong>Kickstarter Pledges</strong> <code>https://cdn.rawgit.com/freeCodeCamp/testable-projects-fcc/a80ce8f9/src/data/tree_map/kickstarter-funding-data.json</code></li><li><strong>Movie Sales</strong> <code>https://cdn.rawgit.com/freeCodeCamp/testable-projects-fcc/a80ce8f9/src/data/tree_map/movie-data.json</code></li><li><strong>Video Game Sales</strong> <code>https://cdn.rawgit.com/freeCodeCamp/testable-projects-fcc/a80ce8f9/src/data/tree_map/video-game-sales-data.json</code></li></ul>
你可以 fork <a href='https://codepen.io/freeCodeCamp/pen/MJjpwO' target='_blank'>这个 CodePen pen 项目</a>来构建你的项目。或者你可以在任何你喜欢的环境中使用以下 CDN 链接来运行测试:<code>https://gitcdn.link/repo/freeCodeCamp/testable-projects-fcc/master/build/bundle.js</code>.
一旦你完成了本项目并且该项目所有测试运行通过,请提交项目的 URL。
</section>
## Instructions
<section id="instructions">
<section id='instructions'>
</section>
## Tests
@ -36,4 +55,4 @@ tests: []
// solution required
```
/section>
</section>