Reduce the plot size by excluding plotlyjs

pull/95/head
Meng Li 2020-03-23 18:24:19 -04:00
parent 0e173872df
commit ac758e3776
4 changed files with 4 additions and 4 deletions

View File

@ -31,4 +31,4 @@ else:
battery_data.set_index(["local_date"], inplace=True)
battery_data = battery_data.resample("1D").asfreq().fillna(0).reset_index()
plot = getBatteryConsumptionRatesBarChart(battery_data, pid)
pio.write_html(plot, file=snakemake.output[0], auto_open=False)
pio.write_html(plot, file=snakemake.output[0], auto_open=False, include_plotlyjs="cdn")

View File

@ -21,7 +21,7 @@ def getComplianceHeatmap(dates, compliance_matrix, pid, output_path, bin_size):
colorscale='Viridis',
colorbar={'tick0': 0,'dtick': 1}))
plot.update_layout(title="Compliance heatmap.<br>Five-minute bins showing how many sensors logged at least one row of data in that period for " + pid + "<br>Label: " + label + ", device_id: " + device_id)
pio.write_html(plot, file=output_path, auto_open=False)
pio.write_html(plot, file=output_path, auto_open=False, include_plotlyjs="cdn")
# get current patient id
pid = snakemake.params["pid"]

View File

@ -21,7 +21,7 @@ def getRowCountHeatmap(dates, row_count_per_bin, sensor_name, pid, output_path,
y=[datetime.datetime.strftime(date, '%Y/%m/%d') for date in dates],
colorscale="Viridis"))
plot.update_layout(title="Row count heatmap for " + sensor_name + " of " + pid + "<br>Label: " + label + ", device_id: " + device_id)
pio.write_html(plot, file=output_path, auto_open=False)
pio.write_html(plot, file=output_path, auto_open=False, include_plotlyjs="cdn")

View File

@ -27,7 +27,7 @@ def getOverallComplianceHeatmap(sensors_with_data, valid_sensed_hours, last_seve
showscale=True)
plot.update_layout(title="Overall compliance heatmap for last seven days.<br>Bin's color shows how many sensors logged at least one row of data for that day.<br>Bin's text shows the valid hours of that day.(A valid hour has at least one row of any sensor in "+ str(min_bins_per_hour) +" out of " + str(int(60 / bin_size)) + " bins of " + str(bin_size) + " minutes)")
plot["layout"]["xaxis"].update(side="bottom")
pio.write_html(plot, file=output_path, auto_open=False)
pio.write_html(plot, file=output_path, auto_open=False, include_plotlyjs="cdn")
phone_sensed_bins = snakemake.input["phone_sensed_bins"]