Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Area, Line, Horizontal and Vertical Bar #23823

Merged
merged 10 commits into from
Oct 18, 2018
16 changes: 8 additions & 8 deletions src/core_plugins/kbn_vislib_vis_types/public/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { Schemas } from 'ui/vis/editors/default/schemas';
import { CATEGORY } from 'ui/vis/vis_category';
import pointSeriesTemplate from './editors/point_series.html';

export default function PointSeriesVisType(Private) {
export default function PointSeriesVisType(Private, i18n) {
const VisFactory = Private(VisFactoryProvider);

return VisFactory.createVislibVisualization({
name: 'area',
title: 'Area',
title: i18n('kbnVislibVisTypes.area.areaTitle', { defaultMessage: 'Area' }),
icon: 'visArea',
description: 'Emphasize the quantity beneath a line chart',
description: i18n('kbnVislibVisTypes.area.areaDescription', { defaultMessage: 'Emphasize the quantity beneath a line chart' }),
category: CATEGORY.BASIC,
visConfig: {
defaults: {
Expand Down Expand Up @@ -140,7 +140,7 @@ export default function PointSeriesVisType(Private) {
{
group: 'metrics',
name: 'metric',
title: 'Y-Axis',
title: i18n('kbnVislibVisTypes.line.yAxisTitle', { defaultMessage: 'Y-Axis' }),
aggFilter: ['!geo_centroid', '!geo_bounds'],
min: 1,
defaults: [
Expand All @@ -150,31 +150,31 @@ export default function PointSeriesVisType(Private) {
{
group: 'metrics',
name: 'radius',
title: 'Dot Size',
title: i18n('kbnVislibVisTypes.line.dotSizeTitle', { defaultMessage: 'Dot Size' }),
min: 0,
max: 1,
aggFilter: ['count', 'avg', 'sum', 'min', 'max', 'cardinality']
},
{
group: 'buckets',
name: 'segment',
title: 'X-Axis',
title: i18n('kbnVislibVisTypes.line.xAxisTitle', { defaultMessage: 'X-Axis' }),
min: 0,
max: 1,
aggFilter: ['!geohash_grid', '!filter']
},
{
group: 'buckets',
name: 'group',
title: 'Split Series',
title: i18n('kbnVislibVisTypes.line.splitSeriesTitle', { defaultMessage: 'Split Series' }),
min: 0,
max: 3,
aggFilter: ['!geohash_grid', '!filter']
},
{
group: 'buckets',
name: 'split',
title: 'Split Chart',
title: i18n('kbnVislibVisTypes.line.splitTitle', { defaultMessage: 'Split Chart' }),
min: 0,
max: 1,
aggFilter: ['!geohash_grid', '!filter']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<div class="kuiSideBarSection kuiSideBarSection__main">
<div class="kuiSideBarSectionTitle">
<div class="kuiSideBarSectionTitle__text">
X-Axis
</div>
<div
class="kuiSideBarSectionTitle__text"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.xAxisTitle"
i18n-default-message="X-Axis"
></div>
</div>

<!-- General -->
<div class="kuiSideBarSection">
<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisShow">
Show
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisShow"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.showLabel"
i18n-default-message="Show"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="categoryAxisShow" type="checkbox" ng-model="editorState.params.categoryAxes[0].show">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisPosition">
Position
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisPosition"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.positionLabel"
i18n-default-message="Position"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="categoryAxisPosition"
Expand All @@ -43,46 +51,64 @@
ng-class="{ 'fa-caret-down': isCategoryAxisAdvancedOptionsOpen, 'fa-caret-right': !isCategoryAxisAdvancedOptionsOpen }"
class="kuiIcon fa-caret-right kuiSideBarOptionsLink__caret"
></span>
<span class="kuiSideBarOptionsLink__text">
<span ng-show="!isCategoryAxisAdvancedOptionsOpen">
Show
</span>
<span ng-show="isCategoryAxisAdvancedOptionsOpen">
Hide
</span>
Advanced Options
<span

This comment was marked as resolved.

class="kuiSideBarOptionsLink__text"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.advancedOptionsTitle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

advancedOptionsTitle => toggleAdvancedOptionsVisibilityLabel

i18n-default-message="Advanced Options"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use i18n-values for text contaning tags

>
<span
ng-show="!isCategoryAxisAdvancedOptionsOpen"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.showTitle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showTitle => showText

i18n-default-message="Show"
></span>
<span
ng-show="isCategoryAxisAdvancedOptionsOpen"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.hideTitle"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hideTitle => hideText

i18n-default-message="Hide"
></span>
</span>
</a>

<div ng-show="isCategoryAxisAdvancedOptionsOpen">
<!-- Labels -->
<div class="kuiSideBarSection">
<h6 class="kuiSideBarFormSectionTitle">
Labels
</h6>
<h6
class="kuiSideBarFormSectionTitle"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.labelsLabel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

labelsLabel => labelsTitle

i18n-default-message="Labels"
></h6>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisShowLabels">
Show Labels
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisShowLabels"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.showLabelsLabel"
i18n-default-message="Show Labels"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="categoryAxisShowLabels" type="checkbox" ng-model="editorState.params.categoryAxes[0].labels.show">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisShowFilter">
Filter Labels
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisShowFilter"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.filterLabelsLabel"
i18n-default-message="Filter Labels"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="categoryAxisShowFilter" type="checkbox" ng-model="editorState.params.categoryAxes[0].labels.filter">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisRotateLabels">
Rotate
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisRotateLabels"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.rotateLabel"
i18n-default-message="Rotate"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="categoryAxisRotateLabels"
Expand All @@ -94,9 +120,12 @@ <h6 class="kuiSideBarFormSectionTitle">
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="categoryAxisTruncateLabels">
Truncate
</label>
<label
class="kuiSideBarFormRow__label"
for="categoryAxisTruncateLabels"
i18n-id="kbnVislibVisTypes.controls.pointSeries.categoryAxis.truncateLabel"
i18n-default-message="Truncate"
></label>
<div class="kuiSideBarFormRow__control">
<input
id="categoryAxisTruncateLabels"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,48 @@
ng-class="{ 'fa-caret-down': isGridOpen, 'fa-caret-right': !isGridOpen }"
class="kuiIcon fa-caret-right kuiSideBarCollapsibleTitle__caret"
></span>
<span class="kuiSideBarCollapsibleTitle__text">
Grid
</span>
<span
class="kuiSideBarCollapsibleTitle__text"
i18n-id="kbnVislibVisTypes.controls.pointSeries.grid.gridLabel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gridLabel => gridText

i18n-default-message="Grid"
></span>
</div>
</div>

<div id="visGridOptions" ng-show="isGridOpen" class="kuiSideBarCollapsibleSection">
<!-- General -->
<div class="kuiSideBarSection">
<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="showCategoryLines">
X-Axis Lines
</label>
<label
class="kuiSideBarFormRow__label"
for="showCategoryLines"
i18n-id="kbnVislibVisTypes.controls.pointSeries.grid.xAxisLinesLabel"
i18n-default-message="X-Axis Lines"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="showCategoryLines" type="checkbox" ng-model="editorState.params.grid.categoryLines">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="gridAxis">
Y-Axis Lines
</label>
<label
class="kuiSideBarFormRow__label"
for="gridAxis"
i18n-id="kbnVislibVisTypes.controls.pointSeries.grid.yAxisLinesLabel"
i18n-default-message="Y-Axis Lines"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="gridAxis"
class="kuiSelect kuiSideBarSelect"
ng-model="editorState.params.grid.valueAxis"
ng-options="axis.id as axis.name for axis in editorState.params.valueAxes track by axis.id"
>
<option value="">Don't show</option>
<option
value=""
i18n-id="kbnVislibVisTypes.controls.pointSeries.grid.dontShowLabel"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grid => gridAxis

i18n-default-message="Don't show"
></option>
</select>
</div>
</div>
Expand Down
Loading