Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"common.ui": "src/ui",
"inputControl":"src/core_plugins/input_control_vis",
"kbn": "src/core_plugins/kibana",
"kbnVislibVisTypes": "src/core_plugins/kbn_vislib_vis_types",
"markdownVis": "src/core_plugins/markdown_vis",
"metricVis": "src/core_plugins/metric_vis",
"statusPage": "src/core_plugins/status_page",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<div class="form-group">
<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="visualizeBasicSettingsLegendPosition">
Legend Position
</label>
<label
class="kuiSideBarFormRow__label"
for="visualizeBasicSettingsLegendPosition"
i18n-id="kbnVislibVisTypes.controls.vislibBasicOptions.legendPositionLabel"
i18n-default-message="Legend Position"
></label>
<div class="kuiSideBarFormRow__control">
<select
id="visualizeBasicSettingsLegendPosition"
Expand All @@ -15,9 +18,12 @@
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="showTooltip">
Show Tooltip
</label>
<label
class="kuiSideBarFormRow__label"
for="showTooltip"
i18n-id="kbnVislibVisTypes.controls.vislibBasicOptions.showTooltipLabel"
i18n-default-message="Show Tooltip"
></label>
<div class="kuiSideBarFormRow__control">
<input id="showTooltip" type="checkbox" ng-model="editorState.params.addTooltip">
</div>
Expand Down
61 changes: 40 additions & 21 deletions src/core_plugins/kbn_vislib_vis_types/public/editors/pie.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<div class="kuiSideBarSection">
<div class="form-group">
<div class="kuiSideBarSectionTitle">
<div class="kuiSideBarSectionTitle__text">
Pie Settings
</div>
<div
class="kuiSideBarSectionTitle__text"
i18n-id="kbnVislibVisTypes.editors.pie.pieSettingsTitle"
i18n-default-message="Pie Settings"
></div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="isDonut">
Donut
</label>
<label
class="kuiSideBarFormRow__label"
for="isDonut"
i18n-id="kbnVislibVisTypes.editors.pie.donutLabel"
i18n-default-message="Donut"
></label>
<div class="kuiSideBarFormRow__control">
<input id="isDonut" name="isDonut" type="checkbox" value="{{isDonut}}"
ng-checked="editorState.params.isDonut"
Expand All @@ -26,42 +31,56 @@
<div class="kuiSideBarSection">
<div class="form-group">
<div class="kuiSideBarSectionTitle">
<div class="kuiSideBarSectionTitle__text">
Labels Settings
</div>
<div
class="kuiSideBarSectionTitle__text"
i18n-id="kbnVislibVisTypes.editors.pie.labelsSettingsTitle"
i18n-default-message="Labels Settings"
></div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="showLabels">
Show Labels
</label>
<label
class="kuiSideBarFormRow__label"
for="showLabels"
i18n-id="kbnVislibVisTypes.editors.pie.showLabelsLabel"
i18n-default-message="Show Labels"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="showLabels" type="checkbox" ng-model="editorState.params.labels.show">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="showLastLevel">
Show Top Level Only
</label>
<label
class="kuiSideBarFormRow__label"
for="showLastLevel"
i18n-id="kbnVislibVisTypes.editors.pie.showTopLevelOnlyLabel"
i18n-default-message="Show Top Level Only"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="showLastLevel" type="checkbox" ng-model="editorState.params.labels.last_level">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="showValues">
Show Values
</label>
<label
class="kuiSideBarFormRow__label"
for="showValues"
i18n-id="kbnVislibVisTypes.editors.pie.showValuesLabel"
i18n-default-message="Show Values"
></label>
<div class="kuiSideBarFormRow__control">
<input class="kuiCheckBox" id="showValues" type="checkbox" ng-model="editorState.params.labels.values">
</div>
</div>

<div class="kuiSideBarFormRow">
<label class="kuiSideBarFormRow__label" for="truncateLabels">
Truncate
</label>
<label
class="kuiSideBarFormRow__label"
for="truncateLabels"
i18n-id="kbnVislibVisTypes.editors.pie.truncateLabel"
i18n-default-message="Truncate"
></label>
<div class="kuiSideBarFormRow__control">
<input
id="truncateLabels"
Expand Down
12 changes: 6 additions & 6 deletions src/core_plugins/kbn_vislib_vis_types/public/pie.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 pieTemplate from './editors/pie.html';

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

return VisFactory.createVislibVisualization({
name: 'pie',
title: 'Pie',
title: i18n('kbnVislibVisTypes.pie.pieTitle', { defaultMessage: 'Pie' }),
icon: 'visPie',
description: 'Compare parts of a whole',
description: i18n('kbnVislibVisTypes.pie.pieDescription', { defaultMessage: 'Compare parts of a whole' }),
category: CATEGORY.BASIC,
visConfig: {
defaults: {
Expand Down Expand Up @@ -67,7 +67,7 @@ export default function HistogramVisType(Private) {
{
group: 'metrics',
name: 'metric',
title: 'Slice Size',
title: i18n('kbnVislibVisTypes.pie.metricTitle', { defaultMessage: 'Slice Size' }),
min: 1,
max: 1,
aggFilter: ['sum', 'count', 'cardinality', 'top_hits'],
Expand All @@ -79,7 +79,7 @@ export default function HistogramVisType(Private) {
group: 'buckets',
name: 'segment',
icon: 'fa fa-scissors',
title: 'Split Slices',
title: i18n('kbnVislibVisTypes.pie.segmentTitle', { defaultMessage: 'Split Slices' }),
min: 0,
max: Infinity,
aggFilter: ['!geohash_grid', '!filter']
Expand All @@ -88,7 +88,7 @@ export default function HistogramVisType(Private) {
group: 'buckets',
name: 'split',
icon: 'fa fa-th',
title: 'Split Chart',
title: i18n('kbnVislibVisTypes.pie.splitTitle', { defaultMessage: 'Split Chart' }),
mustBeFirst: true,
min: 0,
max: 1,
Expand Down