move import

This commit is contained in:
wh1te909 2023-10-27 06:33:10 +00:00
parent 904eb3538c
commit 946de18bea
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,6 @@ import re
from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Tuple, Type, Union, cast
import plotly.express as px
import yaml
from django.apps import apps
from jinja2 import Environment, FunctionLoader
@ -596,6 +595,9 @@ def generate_chart(
traces: Optional[Dict[str, Any]] = None,
layout: Optional[Dict[str, Any]] = None,
) -> str:
### TODO figure out why plotly affects perf
import plotly.express as px
fig = getattr(px, type)(**options)
if traces: