Skip to content

Commit

Permalink
Revert "Renamed parallel coordinates axes"
Browse files Browse the repository at this point in the history
This reverts commit 1004de1.
danyoungday committed Nov 5, 2024
1 parent 1004de1 commit 41df439
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions app/components/filter.py
Original file line number Diff line number Diff line change
@@ -27,11 +27,6 @@ def __init__(self, metrics: list[str]):
with open("app/units.json", "r", encoding="utf-8") as f:
self.units = json.load(f)

self.names_map = dict(zip(self.metrics, ["Temperature change from 1850",
"Highest cost of energy",
"Government spending",
"Reduction in energy demand"]))

def create_metric_sliders(self):
"""
Creates initial metric sliders and lines them up with their labels.
@@ -53,16 +48,17 @@ def create_metric_sliders(self):
)
sliders.append(slider)

names_map = dict(zip(self.metrics, ["Temperature change from 1850",
"Highest cost of energy",
"Government spending",
"Reduction in energy demand"]))
# w-25 and flex-grow-1 ensures they line up
div = html.Div(
children=[
html.Div(
className="d-flex flex-row mb-2",
children=[
html.Label(
f"{self.names_map[self.metrics[i]]} ({self.units[self.metrics[i]]})",
className="w-25"
),
html.Label(f"{names_map[self.metrics[i]]} ({self.units[self.metrics[i]]})", className="w-25"),
html.Div(sliders[i], className="flex-grow-1")
]
)
@@ -83,7 +79,6 @@ def plot_parallel_coordinates_line(self,
fig = go.Figure()

normalized_df = filter_metrics_json(metrics_json, metric_ranges, normalize=True)
normalized_df.rename(self.names_map, axis=1, inplace=True)

cand_idxs = list(normalized_df.index)[:-1] # Leave out the baseline
n_special_cands = min(10, len(cand_idxs))

0 comments on commit 41df439

Please sign in to comment.