https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • m

    miniature-window-68019

    03/21/2023, 9:26 PM
    If I were to design it, I'd use webcomponents for graphs/diagrams
  • g

    gorgeous-airport-54386

    03/21/2023, 9:26 PM
    +1000
  • g

    gorgeous-airport-54386

    03/21/2023, 9:27 PM
    Are there any libraries that progressively enhance tables to charts?
  • s

    some-airline-73512

    03/21/2023, 9:27 PM
    I never used those. Do you mean these? https://www.webcomponents.org/
  • m

    miniature-window-68019

    03/21/2023, 9:27 PM
    I like to use webcomponents when they feel like they could be a standard html component
  • m

    miniature-window-68019

    03/21/2023, 9:27 PM
    yeah, idk if there are any good interactive chart components though
  • m

    miniature-window-68019

    03/21/2023, 9:28 PM
    there are a ton of js chart libraries though, probably wouldn't be too difficult to find one you like and wrap it as a webcomponent yourself
  • s

    some-airline-73512

    03/21/2023, 9:29 PM
    Cool. What advantage would it give? Wrapping the library
  • s

    some-airline-73512

    03/21/2023, 9:29 PM
    I'm zero knowledge about webcomponents
  • m

    miniature-window-68019

    03/21/2023, 9:29 PM
    Then you can treat the library as hypertext and use htmx easily
  • g

    gorgeous-airport-54386

    03/21/2023, 9:30 PM
    With custom elements, the browser handles initialization/destruction. Also, all of the internal elements of the component are isolated for the rest of the DOM and won't interfere with htmx history snapshotting
  • s

    some-airline-73512

    03/21/2023, 9:30 PM
    Cool. That's something
  • m

    miniature-window-68019

    03/21/2023, 9:31 PM
    webcomponents are super simple, they're pretty similar to react class components if you've ever used those
  • g

    gorgeous-airport-54386

    03/21/2023, 9:31 PM
    Copy code
    html
    <my-special-chart type="line">
      <thead><th axis="x" datatype="datetime"> Stuff <th axis="y"> Things
      <tr> 2020 <tr> 100
      <tr> 2021 <tr> 145
      ...
    </my-special-chart>
  • s

    some-airline-73512

    03/21/2023, 9:33 PM
    No, I missed React chapter in the web evolution. I left frontend in 2012ish and got back to it just now.
  • m

    miniature-window-68019

    03/21/2023, 9:33 PM
    Well, they're basically a virtual class where you define a constructor and handle events like when attributes change. Just
    class MyElement extends HTMLElement
  • s

    some-airline-73512

    03/21/2023, 9:33 PM
    I mean not literally now. I've done some stuff with htmx already. I shared screenshots few times here
  • s

    some-airline-73512

    03/21/2023, 9:34 PM
    Cool. I will look into them. Thank you
  • Charts.css
    s

    some-airline-73512

    03/21/2023, 10:03 PM
    I found this one interesting https://chartscss.org/
    g
    • 2
    • 1
  • s

    some-airline-73512

    03/21/2023, 10:04 PM
    It uses html as data source and renders charts with css
  • s

    some-airline-73512

    03/21/2023, 10:04 PM
    No js = ❤️
  • n

    numerous-agent-22346

    03/21/2023, 10:34 PM
    nice!
  • m

    mysterious-car-3675

    03/21/2023, 11:34 PM
    if you are using go there is a package that generates apache echarts on the server and hands off the DOM+js to run as a go template
  • n

    nutritious-account-75037

    03/22/2023, 3:01 AM
    Is there a way to make a POST or GET request to an authenticated (bearer token) API without exposing the token to the client/browser?
  • j

    jolly-waitress-42858

    03/22/2023, 5:50 AM
    has anyone here built a spreadsheet-like frontend using htmx ? any libraries that you used (like tabulator which unfortunately needs jquery). im not keen to build the entire UI from scratch and would much rather use a frontend library or package.
  • s

    some-airline-73512

    03/22/2023, 6:50 AM
    I did. But everything is from scratch
  • j

    jolly-waitress-42858

    03/22/2023, 7:21 AM
    Oh wow. That's commendable 👏👏👏
  • h

    high-holiday-5113

    03/22/2023, 9:56 AM
    As an HTMX beginner, I appreciate the concept of making parts of a page behave like frames. However, I've found that error handling is not quite as similar. For example, when submitting a form and encountering a connection error (such as being in an elevator), users can clearly see the error and have the option to resend the request with frames or whole page submissions. On the other hand, with HTMX, if I'm not mistaken, errors are not displayed by default. So my question is shouldn't we change the default behavior and what are best practices to handle such error now?
  • a

    adventurous-ocean-93733

    03/22/2023, 10:17 AM
    The pattern I’ve used is to use htmx to get/post to my back end and then the back end calls the API. But obviously then your server is the API client.
  • f

    freezing-waitress-26396

    03/22/2023, 10:43 AM
    That's... a thing lol
1...107410751076...1146Latest