def generate_page(): grid = ConnectedCardGrid() existing_card = GraphCard( id='district-heating-existing-building-unit-heat-factor', slider=dict( min=-60, max=20, step=5, value=get_variable( 'district_heating_existing_building_efficiency_change') * 10, marks={x: '%.1f %%' % (x / 10) for x in range(-60, 20 + 1, 10)}, )) new_card = GraphCard( id='district-heating-new-building-unit-heat-factor', slider=dict( min=-60, max=20, step=5, value=get_variable( 'district_heating_new_building_efficiency_change') * 10, marks={x: '%.1f %%' % (x / 10) for x in range(-60, 20 + 1, 10)}, ), ) geo_card = GraphCard(id='district-heating-geothermal-production', link_to_page=('BuildingHeating', 'GeothermalHeating')) row = grid.make_new_row() row.add_card(existing_card) row.add_card(new_card) row.add_card(geo_card) consumption_card = GraphCard( id='district-heating-consumption', extra_content=html.Div(id='district-heating-unit-emissions-card')) existing_card.connect_to(consumption_card) new_card.connect_to(consumption_card) geo_card.connect_to(consumption_card) row = grid.make_new_row() row.add_card(consumption_card) emissions_card = GraphCard(id='district-heating-consumption-emissions') consumption_card.connect_to(emissions_card) row = grid.make_new_row() row.add_card(emissions_card) return html.Div([ grid.render(), html.Div(id='district-heating-sticky-page-summary-container') ])
def generate_page(): grid = ConnectedCardGrid() existing_card = GraphCard( id='solar-power-existing-buildings', slider=dict( min=0, max=90, step=5, value=get_variable('solar_power_existing_buildings_percentage'), marks={x: '%d %%' % x for x in range(0, 90 + 1, 10)}, ), extra_content=html.Div(id='solar-power-existing-kwpa'), ) new_card = GraphCard( id='solar-power-new-buildings', slider=dict( min=20, max=100, step=5, value=get_variable('solar_power_new_buildings_percentage'), marks={x: '%d %%' % x for x in range(20, 100 + 1, 10)}, ), extra_content=html.Div(id='solar-power-new-kwpa'), ) grid.make_new_row() grid.add_card(existing_card) grid.add_card(new_card) production_card = GraphCard(id='solar-power-production') existing_card.connect_to(production_card) new_card.connect_to(production_card) grid.make_new_row() grid.add_card(production_card) emission_card = GraphCard(id='solar-power-emission-reductions') production_card.connect_to(emission_card) grid.make_new_row() grid.add_card(emission_card) return html.Div([ grid.render(), html.Div(id='solar-power-sticky-page-summary-container') ])
def get_content(self): grid = ConnectedCardGrid() grid.make_new_row() c1a = self.get_card('residential-parking-fee') c1b = self.get_card('cars-affected-by-residential-parking-fee') grid.add_card(c1a) grid.add_card(c1b) grid.make_new_row() c2a = self.get_card('modal-share-car') grid.add_card(c2a) c2b = self.get_card('modal-shares-rest') grid.add_card(c2b) c2c = self.get_card('number-of-passenger-kms') grid.add_card(c2c) c1a.connect_to(c2a) c1a.connect_to(c2b) c1b.connect_to(c2a) c1b.connect_to(c2b) grid.make_new_row() c3 = self.get_card('car-mileage-per-resident') grid.add_card(c3) c2a.connect_to(c3) c2c.connect_to(c3) grid.make_new_row() c4a = self.get_card('car-mileage') c4b = self.get_card('car-emission-factor') grid.add_card(c4a) grid.add_card(c4b) c3.connect_to(c4a) grid.make_new_row() c5 = self.get_card('parking-emission-reductions') grid.add_card(c5) c4a.connect_to(c5) c4b.connect_to(c5) return grid.render()
def generate_page(): grid = ConnectedCardGrid() bev_perc_card = GraphCard( id='cars-bev-percentage', slider=dict( min=0, max=100, step=5, value=get_variable('cars_bev_percentage'), marks={x: '%d %%' % x for x in range(0, 100 + 1, 10)}, ), ) per_resident_card = GraphCard( id='cars-mileage-per-resident', slider=dict( min=-60, max=20, step=5, value=get_variable('cars_mileage_per_resident_adjustment'), marks={x: '%d %%' % (x) for x in range(-60, 20 + 1, 10)}, ), ) mileage_card = GraphCard( id='cars-total-mileage', ) emission_factor_card = GraphCard( id='cars-emission-factor', ) emissions_card = GraphCard( id='cars-emissions', ) """ biofuel_card = GraphCard( id='cars-biofuel-percentage', ) """ grid.make_new_row() grid.add_card(bev_perc_card) #grid.add_card(biofuel_card) grid.add_card(per_resident_card) grid.make_new_row() grid.add_card(emission_factor_card) grid.add_card(mileage_card) grid.make_new_row() grid.add_card(emissions_card) bev_perc_card.connect_to(emission_factor_card) #biofuel_card.connect_to(emission_factor_card) emission_factor_card.connect_to(emissions_card) per_resident_card.connect_to(mileage_card) mileage_card.connect_to(emissions_card) return html.Div([ grid.render(), html.Div(id='cars-sticky-page-summary-container') ])
def get_content(self): grid = ConnectedCardGrid() grid.make_new_row() c1a = self.get_card('renovated-per-year') grid.add_card(c1a) c1b = self.get_card('new-building-installation') grid.add_card(c1b) """ grid.make_new_row() c2a = self.get_card('boreholes-existing-buildings') c2b = self.get_card('boreholes-new-buildings') grid.add_card(c2a) grid.add_card(c2b) c1a.connect_to(c2a) c1b.connect_to(c2b) """ grid.make_new_row() c3a = self.get_card('geothermal-production') c3b = self.get_card('electricity-emission-factor') c3c = self.get_card('district-heat-emission-factor') grid.add_card(c3a) grid.add_card(c3b) grid.add_card(c3c) c1a.connect_to(c3a) c1b.connect_to(c3a) grid.make_new_row() c4 = self.get_card('emissions') grid.add_card(c4) c3a.connect_to(c4) c3b.connect_to(c4) c3c.connect_to(c4) return grid.render()
def get_content(self): grid = ConnectedCardGrid() grid.make_new_row() c1a = self.get_card('ev-parking-fee-discount') c1b = self.get_card('share-of-ev-charging-stations-built') c1c = self.get_card('cars-per-resident') grid.add_card(c1a) grid.add_card(c1b) grid.add_card(c1c) grid.make_new_row() c2a = self.get_card('newly-registered-evs') c2b = self.get_card('yearly-fleet-turnover') grid.add_card(c2a) grid.add_card(c2b) c1a.connect_to(c2a) c1b.connect_to(c2a) c1c.connect_to(c2b) grid.make_new_row() c3 = self.get_card('car-fleet') grid.add_card(c3) c2a.connect_to(c3) c2b.connect_to(c3) grid.make_new_row() c4a = self.get_card('emission-factor') c4b = self.get_card('mileage') grid.add_card(c4a) grid.add_card(c4b) c3.connect_to(c4a) grid.make_new_row() c5 = self.get_card('emission-impact') grid.add_card(c5) c4a.connect_to(c5) c4b.connect_to(c5) return grid.render()
def get_content(self): grid = ConnectedCardGrid() """ biofuel_card = GraphCard( id='cars-biofuel-percentage', ) """ grid.make_new_row() c1a = self.get_card('bev-percentage') c1b = self.get_card('mileage-per-resident') grid.add_card(c1a) grid.add_card(c1b) grid.make_new_row() c2a = self.get_card('emission-factor') c2b = self.get_card('total-mileage') grid.add_card(c2a) grid.add_card(c2b) c1a.connect_to(c2a) c1b.connect_to(c2b) grid.make_new_row() c3 = self.get_card('emissions') grid.add_card(c3) c2a.connect_to(c3) c2b.connect_to(c3) return grid.render()
def get_content(self): grid = ConnectedCardGrid() grid.make_new_row() c1a = self.get_card('existing-buildings') c1b = self.get_card('new-buildings') grid.add_card(c1a) grid.add_card(c1b) grid.make_new_row() c2a = self.get_card(id='production') grid.add_card(c2a) c1a.connect_to(c2a) c1b.connect_to(c2a) grid.make_new_row() c3a = self.get_card(id='emission-impact') grid.add_card(c3a) c2a.connect_to(c3a) return grid.render()
def render_page(): grid = ConnectedCardGrid() per_capita_card = GraphCard( id='electricity-consumption-per-capita', slider=dict( min=-50, max=20, step=5, value=int( get_variable('electricity_consumption_per_capita_adjustment') * 10), marks={x: '%d %%' % (x / 10) for x in range(-50, 20 + 1, 10)}, )) solar_card = GraphCard(id='electricity-consumption-solar-production', link_to_page=('ElectricityConsumption', 'SolarProduction')) grid.make_new_row() grid.add_card(per_capita_card) grid.add_card(solar_card) consumption_card = GraphCard(id='electricity-consumption') emission_factor_card = GraphCard( id='electricity-consumption-emission-factor') per_capita_card.connect_to(consumption_card) solar_card.connect_to(consumption_card) grid.make_new_row() grid.add_card(consumption_card) grid.add_card(emission_factor_card) emission_card = GraphCard(id='electricity-consumption-emissions') consumption_card.connect_to(emission_card) emission_factor_card.connect_to(emission_card) grid.make_new_row() grid.add_card(emission_card) return html.Div(children=[ grid.render(), html.Div(id='electricity-consumption-summary-bar') ])
def render_page(): grid = ConnectedCardGrid() per_capita_card = GraphCard( id='electricity-consumption-per-capita', slider=dict( min=-50, max=20, step=5, value=get_variable( 'electricity_consumption_per_capita_adjustment'), marks={x: '%d %%' % (x / 10) for x in range(-50, 20 + 1, 10)}, )) grid.make_new_row() grid.add_card(per_capita_card) consumption_card = GraphCard(id='electricity-consumption') emission_factor_card = GraphCard( id='electricity-consumption-emission-factor') per_capita_card.connect_to(consumption_card) grid.make_new_row() grid.add_card(consumption_card) grid.add_card(emission_factor_card) emission_card = GraphCard(id='electricity-consumption-emissions') consumption_card.connect_to(emission_card) emission_factor_card.connect_to(emission_card) grid.make_new_row() grid.add_card(emission_card) return grid.render()