[HN Gopher] Offline-First PWA for Plotly Visualization of CSV vi...
___________________________________________________________________
 
Offline-First PWA for Plotly Visualization of CSV via SQLite
 
Author : lana-k
Score  : 164 points
Date   : 2021-05-15 13:48 UTC (9 hours ago)
 
web link (github.com)
w3m dump (github.com)
 
| jimsparkman wrote:
| This looks really great, like a local version of redash but way
| more in the way of charting options. Such simplicity to boot.
 
| kwhitefoot wrote:
| PWA?
 
  | code-is-code wrote:
  | Progressive Web App
 
  | rubiquity wrote:
  | Programmaz Wit Attitudes
 
| rebhan wrote:
| Why Plotly, isnt https://echarts.apache.org/en/index.html more
| powerful ?
 
  | lana-k wrote:
  | Plotly has this: https://github.com/plotly/react-chart-editor.
  | Is there something similar for echarts?
  | 
  | Anyway, thank you for a hint.
 
  | akdor1154 wrote:
  | I can't tell, their lets-reimplement-scrolling-in-js gallery
  | page is breaking in my Firefox.
 
| chunkyks wrote:
| I was looking for something like this the other day. I ended up
| just implementing functions directly in sql like
| plot_bar(category, value), plot_points(xval, yval), which open a
| popup with the chart.
 
| technologia wrote:
| This is great, your demo's music just made the task seem
| hilariously easy.
 
| hmsimha wrote:
| This seems really neat. Curious if you saw this magic SQLite ->
| Static file tool shared here a couple of weeks ago:
| https://news.ycombinator.com/item?id=27016630
| 
| IIUC It would enable this tool to work with a dataset in sqlite
| that could be recompiled as static files periodically, and the
| relevant queries could be made on the front-end without having to
| load the whole data-set or select a CSV file from the filesystem.
| Would also lead to much better performance if you want users to
| be able to host generated charts on a static file server,
| presumably the output could be committed to git and then synced
| to a github pages or something.
| 
| edit: It appears the author of that tool is using Plotly as well
| in the demo website. An integration of these would be incredible.
 
| klmadfejno wrote:
| Perhaps a dumb question but why is offline stressed so much here?
| Nothing in the underlying tech seems to suggest one should expect
| it to not work offline?
 
  | EvilEy3 wrote:
  | Because you don't want your application to become potato on
  | each network hiccup?
 
  | aseipp wrote:
  | You need to use specific browser APIs (Service Workers) in
  | order to support "offline mode" for a webpage, including
  | support when there's no internet at all. This means the page
  | and its content is stored locally for later, separately from
  | normal HTTP caching.
  | 
  | Yes, if you loaded the page once into a tab and then never
  | closed it ever again, then it doesn't matter so much and you
  | could use it if your internet shat out, but in practice people
  | close and then re-open things later under varying network
  | conditions.
 
  | osrec wrote:
  | Browser based apps generally struggle to function well offline
  | (this is also true of certain native apps, but that's a whole
  | other discussion). Using the PWA "toolbox" you can have in-
  | browser apps stored locally via service workers so that they
  | work without needing to fetch anything via the internet.
  | 
  | It's rather useful, and can provide a much better user
  | experience, especially when you have a patchy network.
 
    | tmpz22 wrote:
    | What's an example of a large tech product that functions as a
    | PWA that users really love?
 
      | jononor wrote:
      | Dunno about "really love" anymore, but gmail?
 
      | osrec wrote:
      | There's Twitter's PWA, which isn't too bad in my opinion.
      | 
      | My product has approx 300k users and is a PWA:
      | https://usebx.com - our users seem to like it :)
 
        | dkarp wrote:
        | If you don't mind me asking, how does your product make
        | money?
 
        | osrec wrote:
        | We have a quota on the number of documents you can
        | create, after which you must subscribe. It's a very
        | generous quota, but we still have a good number of people
        | subscribing.
        | 
        | Our major income comes from larger corporate contracts
        | with medium to large businesses, that deploy our product
        | on-prem. Often these were people who used our SaaS
        | product, liked it, and asked us to deploy it internally
        | for their business. Much less hassle than running a
        | company that's purely SaaS based, and more stable income!
 
      | echoradio wrote:
      | I don't know if meets the condition of "users really love,"
      | but don't Google Docs have the capability of functioning as
      | an offline PWA?
 
  | lana-k wrote:
  | Other users have already explained the technical aspect of PWA
  | (i.e. you can install it and run offline as a desktop app). I
  | just want to add that by offline-first I also mean
  | confidentiality -- your data doesn't leave your device, whether
  | you're offline or not.
 
| osrec wrote:
| Really like the concept and demo. And it looks well made! Just
| out of interest, is this something you did as a hobby/for fun, or
| was there a particular use case you were addressing?
 
  | lana-k wrote:
  | It started as a collaboration with
  | https://pypi.org/project/Procpath/. For me as a frontend
  | developer it's an interesting challenge to develop, in fact, a
  | desktop app (with background workers running a database and
  | exchanging data with the main thread and so on) in the form of
  | progressive web app (PWA).
  | 
  | But in general I want to solve a problem: a lot of people know
  | SQL which is actually powerful to wrangle data to prepare it
  | for visualisation and analysis. It can't be simpler than drag-
  | and-dropping a CSV into a browser, producing a result set and
  | consuming it by the visualisation component (now Plotly, but
  | more to come).
 
    | osrec wrote:
    | Genuinely impressed! For me, the most impressive part is the
    | configurability of the charts. Did you implement each
    | configuration for each chart type individually, or were you
    | leveraging some library to help populate the chart
    | configuration parameters?
 
___________________________________________________________________
(page generated 2021-05-15 23:00 UTC)