Coder Social home page Coder Social logo

Comments (3)

AMoo-Miki avatar AMoo-Miki commented on June 8, 2024

@replacementAI I don't know of a plugin that does that specifically but you would get a lot more eyes on this issue if you post about it on https://forum.opensearch.org.

from opensearch-dashboards.

AMoo-Miki avatar AMoo-Miki commented on June 8, 2024

@replacementAI I am not sure if this will help you or not but if you will be having only one type of image encoded in base64, you can use them without a plugin. I will add an example in a few minutes.

from opensearch-dashboards.

AMoo-Miki avatar AMoo-Miki commented on June 8, 2024
// Create an index
PUT /base64

// Set the mapping up to be keyword so I can use it in aggregations; text would work otherwise
PUT /base64/_mapping
{
  "properties": {
    "image": {
      "type": "keyword"
    }
  }
}

// Add some images
POST /base64/_doc 
{
  "image": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNCAxNCIgaGVpZ2h0PSIxNCI+PHBhdGggZmlsbD0iI0M5MDAwMCIgZD0iTTEgNmgxMnYySDF6Ii8+PC9zdmc+"
}


POST /base64/_doc 
{
  "image": "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNCAxNCIgaGVpZ2h0PSIxNCI+PHBhdGggZmlsbD0iIzE4QjI0QiIgZD0iTTEzIDZIOFYxSDZ2NUgxdjJoNXY1aDJWOGg1eiIvPjwvc3ZnPg=="
}

The I created an index pattern for base64 (my index). I edited the image field by:

  1. setting "format" as Url
  2. setting "type" as Image
  3. setting "URL Template" to data:image/svg+xml;base64,{{value}}

My images are SVGs and the "URL Template" matches the data-URIs for SVG images.

I then created a Data Table visualization and the images showed fine. However, Area and Bar visualizations were adamant to use the text and I don't think they are hooked to interpret the format correctly.

from opensearch-dashboards.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.