Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
Flask Plotly Responsivo en el navegador

Cómo hacer que este gráfico de trama responda en index.html: creo una aplicación de matraz y una función js para representar la trama, sin embargo, no puedo entender cómo hacer que responda. Lo que está mal con la configuración variable: parece que no funciona.

Gracias

Matraz:

 @app.route('/') def index(): locations = sorted(df['location'].unique()) rooms = sorted(df['rooms'].unique()) # Visualisation import json import plotly import plotly.express as px df.rooms = df.rooms.astype(str) fig = px.scatter(df, x="m2", y="price", trendline="ols", color="rooms", symbol='rooms', marginal_x="histogram", marginal_y="rug", template='plotly_dark', hover_data=['price', 'rooms', 'm2', 'location'], title="Real Estate in Vienna") graphJSON = json.dumps(fig, cls=plotly.utils.PlotlyJSONEncoder) return render_template('index.html', locations=locations, rooms=rooms, graphJSON=graphJSON)

JavaScript:

 <!-- Visualisation --> {%block content%} <div class="card mb-4 m-auto" style="width: 90%"> <div class="card-body"> <div id="chart"></div> </div> </div> {% endblock %} <!-- Plotly --> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> <script type="text/javascript"> var graphs = {{ graphJSON | safe}}; var config = {responsive: true}; Plotly.newPlot("chart", graphs, {}, config); </script>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!