diff --git a/client/app/assets/less/inc/visualizations/map.less b/client/app/assets/less/inc/visualizations/map.less
index bbef854b0..39d0bc54b 100644
--- a/client/app/assets/less/inc/visualizations/map.less
+++ b/client/app/assets/less/inc/visualizations/map.less
@@ -1,3 +1,37 @@
.map-visualization-container {
height: 500px;
+
+ > div:first-child {
+ width: 100%;
+ height: 100%;
+ z-index: 0;
+ }
+
+ .map-custom-control.leaflet-bar {
+ background: #fff;
+ padding: 10px;
+ margin: 10px;
+ position: absolute;
+ z-index: 1;
+
+ &.top-left {
+ left: 0;
+ top: 0;
+ }
+
+ &.top-right {
+ right: 0;
+ top: 0;
+ }
+
+ &.bottom-left {
+ left: 0;
+ bottom: 0;
+ }
+
+ &.bottom-right {
+ right: 0;
+ bottom: 0;
+ }
+ }
}
diff --git a/client/app/components/dynamic-table/default-cell/utils.js b/client/app/components/dynamic-table/default-cell/utils.js
index e73e6bc51..e6f849e66 100644
--- a/client/app/components/dynamic-table/default-cell/utils.js
+++ b/client/app/components/dynamic-table/default-cell/utils.js
@@ -1,21 +1,14 @@
-import { isUndefined, isFunction } from 'underscore';
-
-const hasOwnProperty = Object.prototype.hasOwnProperty;
+import { isFunction, extend } from 'underscore';
+import { formatSimpleTemplate } from '@/lib/value-format';
function trim(str) {
return str.replace(/^\s+|\s+$/g, '');
}
function processTags(str, data, defaultColumn) {
- return str.replace(/{{\s*([^\s]+)\s*}}/g, (match, column) => {
- if (column === '@') {
- column = defaultColumn;
- }
- if (hasOwnProperty.call(data, column) && !isUndefined(data[column])) {
- return data[column];
- }
- return match;
- });
+ return formatSimpleTemplate(str, extend({
+ '@': data[defaultColumn],
+ }, data));
}
export function renderDefault(column, row) {
diff --git a/client/app/lib/value-format.js b/client/app/lib/value-format.js
index b2dbd9ffb..650866dcc 100644
--- a/client/app/lib/value-format.js
+++ b/client/app/lib/value-format.js
@@ -5,6 +5,8 @@ import _ from 'underscore';
// eslint-disable-next-line
const urlPattern = /(^|[\s\n]|
)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;
+const hasOwnProperty = Object.prototype.hasOwnProperty;
+
function createDefaultFormatter(highlightLinks) {
if (highlightLinks) {
return (value) => {
@@ -50,7 +52,7 @@ function createNumberFormatter(format) {
return value => value;
}
-export default function createFormatter(column) {
+export function createFormatter(column) {
switch (column.displayAs) {
case 'number': return createNumberFormatter(column.numberFormat);
case 'boolean': return createBooleanFormatter(column.booleanValues);
@@ -58,3 +60,15 @@ export default function createFormatter(column) {
default: return createDefaultFormatter(column.allowHTML && column.highlightLinks);
}
}
+
+export function formatSimpleTemplate(str, data) {
+ if (!_.isString(str)) {
+ return '';
+ }
+ return str.replace(/{{\s*([^\s]+)\s*}}/g, (match, prop) => {
+ if (hasOwnProperty.call(data, prop) && !_.isUndefined(data[prop])) {
+ return data[prop];
+ }
+ return match;
+ });
+}
diff --git a/client/app/visualizations/chart/plotly/utils.js b/client/app/visualizations/chart/plotly/utils.js
index 6fe28533c..015960229 100644
--- a/client/app/visualizations/chart/plotly/utils.js
+++ b/client/app/visualizations/chart/plotly/utils.js
@@ -3,7 +3,7 @@ import {
each, values, sortBy, pluck, identity, filter, map,
} from 'underscore';
import moment from 'moment';
-import createFormatter from '@/lib/value-format';
+import { createFormatter } from '@/lib/value-format';
// The following colors will be used if you pick "Automatic" color.
const BaseColors = {
diff --git a/client/app/visualizations/choropleth/choropleth-editor.html b/client/app/visualizations/choropleth/choropleth-editor.html
new file mode 100644
index 000000000..9b7b7b429
--- /dev/null
+++ b/client/app/visualizations/choropleth/choropleth-editor.html
@@ -0,0 +1,202 @@
+
{{ column_name }} syntax.{{ @@value }} formatted value;{{ @@name }} short country name;{{ @@name_long }} full country name;{{ @@abbrev }} abbreviated country name;{{ @@iso_a2 }} two-letter ISO country code;{{ @@iso_a3 }} three-letter ISO country code;{{ @@iso_n3 }} three-digit ISO country code.| Name | @@ -50,14 +50,14 @@|
|---|---|
| {{name}} | - + |