mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
Added DeckGL.Polygon Layer w/ JS controls (#4227)
* Working polygon layer for deckGL * add js controls * add thumbnail * better description * refactor to leverage line_column controls * templates: open code and documentation on a new tab (#4217) As they are external resources. * Fix tutorial doesn't match the current interface #4138 (#4215) * [bugfix] markup and iframe viz raise 'Empty query' (#4225) closes https://github.com/apache/incubator-superset/issues/4222 Related to: https://github.com/apache/incubator-superset/pull/4016 * [bugfix] time_pivot entry got missing in merge conflict (#4221) PR here https://github.com/apache/incubator-superset/pull/3518 missed a line of code while merging conflicts with time_pivot viz * Improve deck.gl GeoJSON visualization (#4220) * Improve geoJSON * Addressing comments * lint * refactor to leverage line_column controls * refactor to use DeckPathViz * oops
This commit is contained in:
committed by
Maxime Beauchemin
parent
cab8e7d22d
commit
5079b2aa95
@@ -1552,6 +1552,36 @@ def load_paris_iris_geojson():
|
||||
tbl.fetch_metadata()
|
||||
|
||||
|
||||
def load_sf_population_polygons():
|
||||
tbl_name = 'sf_population_polygons'
|
||||
|
||||
with gzip.open(os.path.join(DATA_FOLDER, 'sf_population.json.gz')) as f:
|
||||
df = pd.read_json(f)
|
||||
df['contour'] = df.contour.map(json.dumps)
|
||||
|
||||
df.to_sql(
|
||||
tbl_name,
|
||||
db.engine,
|
||||
if_exists='replace',
|
||||
chunksize=500,
|
||||
dtype={
|
||||
'zipcode': BigInteger,
|
||||
'population': BigInteger,
|
||||
'contour': Text,
|
||||
'area': BigInteger,
|
||||
},
|
||||
index=False)
|
||||
print("Creating table {} reference".format(tbl_name))
|
||||
tbl = db.session.query(TBL).filter_by(table_name=tbl_name).first()
|
||||
if not tbl:
|
||||
tbl = TBL(table_name=tbl_name)
|
||||
tbl.description = "Population density of San Francisco"
|
||||
tbl.database = get_or_create_main_db()
|
||||
db.session.merge(tbl)
|
||||
db.session.commit()
|
||||
tbl.fetch_metadata()
|
||||
|
||||
|
||||
def load_bart_lines():
|
||||
tbl_name = 'bart_lines'
|
||||
with gzip.open(os.path.join(DATA_FOLDER, 'bart-lines.json.gz')) as f:
|
||||
|
||||
Reference in New Issue
Block a user