Skip to content

Commit

Permalink
Merge pull request #1616 from CartoDB/release/1.0.2
Browse files Browse the repository at this point in the history
Release/1.0.2
  • Loading branch information
Jesus89 authored Apr 6, 2020
2 parents b6829bb + 023afb6 commit 5eb757d
Show file tree
Hide file tree
Showing 139 changed files with 9,853 additions and 7,297 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ _build
# Distribution / packaging
.Python
env/
.venv/
build/
develop-eggs/
dist/
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ install:
script:
- tox
after_success:
- coveralls
- coveralls
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,52 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2020-
## [1.0.2] - 2020-04-06

### Added
- Add geometry icon to single legends (#1580)
- Publish Layout (#1598)

### Changed
- Use Enrichment API and Metadata API for DO features (#1575, #1594)
- Improve to_csv info message (#1589)
- Use default credentials in metrics (#1603)
- Improve Layout map ordering (#1597)
- Change numeric autoformat (remove scientific notation)
- Return normalized table name in to_carto (#1609)
- Remove empty geometries in Source (#1610)
- Improve docs and examples (#1608, #1611)
- Update catalog info structure (#1612, #1606)

### Fixed
- Allow using columns with symbols in visualization (#1585)
- Fix layer_selector without style helpers (#1580)
- Fix layer_selector in published maps (#1595)
- Fix Google geocoding (#1600)
- Fix legends in Layout (#1597)

## [1.0.1] - 2020-02-28

### Added
- Add encode_data param to Layer (#1536)
- Add WKT case in CSV example (#1545)
- Add Data Management guide (#1547)
- Layer selector in legends (#1551, #1558)
- New 'ascending' parameter to sort numeric legends in ascending or descending order (#1537)

### Changed
- Include user_id in metrics (#1539)
- Disable default param exclusive for isolines (#1540)
- Disable default param exclusive for isolines (1540)
- Raise an error when trying to visualise a multi-geom GeoDataFrame (#1541)
- Update installation guide structure (#1549)
- Minor examples/guides improvements (#1534, #1552)
- Numeric legends are sorted in descending order by default (#1537)

### Fixed
- Fix legend footer in published maps (#1523)
- Fix default legend for cluster_size_style (#1533)
- Fix DO doc reference generation (#1550)
- Fix get token for Mapbox styles (#1565)

## [1.0.0] - 2020-01-20

Expand Down Expand Up @@ -118,13 +146,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix DataObsClient (#1319)
- Fix CartoDataFrame plot (#1339)
- Fix enrichment without subscriptions (#1314)
- Fix encoding detection with all Nones (#1346)
- Fix encoding detection with all Nones (#1346)

## [1.0b6] - 2019-12-02
### Added
- Add new properties in Catalog Dataset and Geography (#1209)
- Add IO functions and CartoDataFrame class (#1130, #1245)
- IO functions: read_carto, to_carto, has_table, describe_table,
- IO functions: read_carto, to_carto, has_table, describe_table,
update_table, copy_table, create_table_from_query, delete_table.
- CartoDataFrame class: inherit GeoDataFrame class + from_carto, to_carto, viz.
- Refactor internals: ContextManager, SourceManager.
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ CARTOframes

.. image:: https://travis-ci.org/CartoDB/cartoframes.svg?branch=develop
:target: https://travis-ci.org/CartoDB/cartoframes
.. image:: https://img.shields.io/badge/pypi-v1.0.1-orange
:target: https://pypi.org/project/cartoframes/1.0.1
.. image:: https://img.shields.io/badge/pypi-v1.0.2-orange
:target: https://pypi.org/project/cartoframes/1.0.2

A Python package for integrating `CARTO <https://carto.com/>`__ maps, analysis, and data services into data science workflows.

Expand All @@ -14,11 +14,11 @@ Python data analysis workflows often rely on the de facto standards `pandas <htt
Try it Out
==========

* Stable (1.0.1): |stable|
* Stable (1.0.2): |stable|
* Latest (develop branch): |develop|

.. |stable| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/v1.0.1?filepath=examples
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/v1.0.2?filepath=examples

.. |develop| image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/cartodb/cartoframes/develop?filepath=examples
Expand Down
2 changes: 1 addition & 1 deletion binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cartoframes==1.0.1
cartoframes==1.0.2
# Additional dependencies from examples
matplotlib
dask
Expand Down
2 changes: 1 addition & 1 deletion cartoframes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


# Check installed packages versions
check_package('carto', '>=1.8.3')
check_package('carto', '>=1.10.0')
check_package('pandas', '>=0.23.0')
check_package('geopandas', '>=0.6.0')

Expand Down
2 changes: 1 addition & 1 deletion cartoframes/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.1'
__version__ = '1.0.2'
2 changes: 1 addition & 1 deletion cartoframes/assets/init.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ document
const camera = {{ camera|tojson }};
const has_legends = '{{has_legends}}' === 'True';
const is_static = '{{is_static}}' === 'True';
const layer_selector = '{{layer_selector}}' === 'True'; // TODO it will be a helper
const layer_selector = '{{layer_selector}}' === 'True';
const layers = {{ layers|tojson }};
const mapboxtoken = '{{mapboxtoken}}';
const show_info = '{{show_info}}' === 'True';
Expand Down
5 changes: 0 additions & 5 deletions cartoframes/assets/init_layout.js.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ const maps = {{ maps|tojson }};
const show_info = '{{show_info}}' === 'True';
const is_static = '{{is_static}}' === 'True';

maps.forEach((map) => {
map.has_legends = false;
map.layer_selector = false;
});

init({
show_info,
is_static,
Expand Down
31 changes: 12 additions & 19 deletions cartoframes/assets/src/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,12 @@ var init = (function () {
}

function formatNumber(value) {
const log = Math.log10(Math.abs(value));

if ((log > 4 || log < -2.00000001) && value) {
return value.toExponential(2);
}

if (!Number.isInteger(value)) {
return value.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 3
});
}

return value.toLocaleString();
}

Expand Down Expand Up @@ -481,7 +474,6 @@ var init = (function () {
throw e;
}


mapLayer.addTo(map);

setLayerLegend(layer, mapLayerIndex, mapLayer, mapIndex, hasLegends);
Expand Down Expand Up @@ -590,7 +582,7 @@ var init = (function () {
);

if (settings.layer_selector) {
addLayersSelector(layers.reverse(), mapLayers.reverse());
addLayersSelector(layers.reverse(), mapLayers.reverse(), mapIndex);
}

setInteractiveLayers(map, layers, mapLayers);
Expand Down Expand Up @@ -628,16 +620,17 @@ var init = (function () {
}
}

function addLayersSelector(layers, mapLayers) {
const layerSelector$ = document.querySelector(`#layer-selector`);
const layersInfo = mapLayers.map((layer, index) => {
return {
title: layers[index].title || `Layer ${index}`,
id: layer.id,
checked: true
};
});

function addLayersSelector(layers, mapLayers, mapIndex) {
const layerSelectorId = mapIndex !== undefined ? `#layer-selector-${mapIndex}` : '#layer-selector';
const layerSelector$ = document.querySelector(layerSelectorId);
const layersInfo = mapLayers.map((layer, index) => {
return {
title: layers[index].title || `Layer ${index}`,
id: layer.id,
checked: true
};
});

const layerSelector = new AsBridge.VL.Layers(layerSelector$, carto, layersInfo, mapLayers);

layerSelector.build();
Expand Down
1 change: 0 additions & 1 deletion cartoframes/assets/src/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export function initMapLayer(layer, layerIndex, numLayers, hasLegends, map, mapI
throw e;
}


mapLayer.addTo(map);

setLayerLegend(layer, mapLayerIndex, mapLayer, mapIndex, hasLegends);
Expand Down
23 changes: 12 additions & 11 deletions cartoframes/assets/src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function initLayers(map, settings, mapIndex) {
);

if (settings.layer_selector) {
addLayersSelector(layers.reverse(), mapLayers.reverse());
addLayersSelector(layers.reverse(), mapLayers.reverse(), mapIndex);
}

setInteractiveLayers(map, layers, mapLayers);
Expand Down Expand Up @@ -87,16 +87,17 @@ export function setInteractiveLayers(map, layers, mapLayers) {
}
}

export function addLayersSelector(layers, mapLayers) {
const layerSelector$ = document.querySelector(`#layer-selector`);
const layersInfo = mapLayers.map((layer, index) => {
return {
title: layers[index].title || `Layer ${index}`,
id: layer.id,
checked: true
};
});

export function addLayersSelector(layers, mapLayers, mapIndex) {
const layerSelectorId = mapIndex !== undefined ? `#layer-selector-${mapIndex}` : '#layer-selector';
const layerSelector$ = document.querySelector(layerSelectorId);
const layersInfo = mapLayers.map((layer, index) => {
return {
title: layers[index].title || `Layer ${index}`,
id: layer.id,
checked: true
};
});

const layerSelector = new AsBridge.VL.Layers(layerSelector$, carto, layersInfo, mapLayers);

layerSelector.build();
Expand Down
7 changes: 0 additions & 7 deletions cartoframes/assets/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,12 @@ export function formatValue(value) {
}

export function formatNumber(value) {
const log = Math.log10(Math.abs(value));

if ((log > 4 || log < -2.00000001) && value) {
return value.toExponential(2);
}

if (!Number.isInteger(value)) {
return value.toLocaleString(undefined, {
minimumFractionDigits: 2,
maximumFractionDigits: 3
});
}

return value.toLocaleString();
}

Expand Down
5 changes: 5 additions & 0 deletions cartoframes/assets/style/common.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@
max-width: 100%;
height: auto;
}
as-layer-selector-slot .as-layer-selector-slot--wrapper .as-caption { // FIXME
font-size: 14px;
line-height: 14px;
}
</style>
28 changes: 15 additions & 13 deletions cartoframes/assets/style/layout.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,50 @@
height: 250px;
justify-content: center;
width: 100%;
height: 100%;
padding: 8px;
position: relative;
}
.layout-map-cell-legend {
flex-direction: row;
}
h2.as-widget-header__header {
font-size: 12px;
line-height: 12px;
padding: 8px 0;
}
.layout-map {
background-color: silver;
height: 100%;
width: 85%;
}
.layout-map > .as-map-area,
.map-image > .as-map-area {
height: 100%;
}
.layer-selector {
margin-bottom: 12px;
}
.layout-map-container {
align-items: center;
display: flex;
flex-direction: row;
flex-direction: column;
justify-content: space-around;
width: 100%;
height: 100%;
padding: 0 8px;
}
.layout-map-row {
display: flex;
flex-direction: column;
flex-direction: row;
justify-content: space-around;
width: 100%;
height: 100%;
}
.layout-legends {
background-color: white;
}
.layout-map-cell--section {
position: relative;
width: 100%;
height: 100%;
}
</style>
Loading

0 comments on commit 5eb757d

Please sign in to comment.