Skip to content

Commit

Permalink
fix: Default height/width to 100% if either doesn't exist (#733)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry authored Aug 6, 2024
1 parent 96ade56 commit 24c8d91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions graphs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,36 +158,36 @@ def get_object(self, request, *args, **kwargs):
if graph == "tree":
options["width"] = int(
self.request.query_params.get(
"width", settings["sunburst"]["options"]["width"]
"width", settings["sunburst"]["options"]["width"] or 100
)
)
options["height"] = int(
self.request.query_params.get(
"height", settings["sunburst"]["options"]["height"]
"height", settings["sunburst"]["options"]["height"] or 100
)
)
return tree(flare, None, None, **options)
elif graph == "icicle":
options["width"] = int(
self.request.query_params.get(
"width", settings["icicle"]["options"]["width"]
"width", settings["icicle"]["options"]["width"] or 100
)
)
options["height"] = int(
self.request.query_params.get(
"height", settings["icicle"]["options"]["height"]
"height", settings["icicle"]["options"]["height"] or 100
)
)
return icicle(flare, **options)
elif graph == "sunburst":
options["width"] = int(
self.request.query_params.get(
"width", settings["sunburst"]["options"]["width"]
"width", settings["sunburst"]["options"]["width"] or 100
)
)
options["height"] = int(
self.request.query_params.get(
"height", settings["sunburst"]["options"]["height"]
"height", settings["sunburst"]["options"]["height"] or 100
)
)
return sunburst(flare, **options)
Expand Down

0 comments on commit 24c8d91

Please sign in to comment.