Giter VIP home page Giter VIP logo

Comments (7)

AjayThorve avatar AjayThorve commented on May 18, 2024

okay, this is certainly possible. It is slightly different than generating a heatmap as it works only with a cudf dataframe with 2 columns as x,y-coordinates and another column as aggregate values.

My assumption is(from the examples you suggest), you would like to generate an image from a (n*n) cupy array by just providing a color palette.

Taking inspiration from the bokeh example, would something like this work for you? :

import cupy, cuxfilter
N = 500
x = cupy.linspace(0, 10, N)
y = cupy.linspace(0, 10, N)
xx, yy = cupy.meshgrid(x, y)
cupy_arr = cupy.sin(xx)*cupy.cos(yy)

cux_df = cuxfilter.DataFrame.from_cupy(cupy_arr)

chart1 = cuxfilter.image(color_palette='Spectral11', origin='bottom-left')
d = cux_df.dashboard([chart1])

chart1.view()

image

from cuxfilter.

jakirkham avatar jakirkham commented on May 18, 2024

Thanks @AjayThorve! I think that would do nicely 😀

from cuxfilter.

jakirkham avatar jakirkham commented on May 18, 2024

So I ran this, but got the following error. Am just running from master.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-3a90a8595424> in <module>
----> 1 import cupy, cuxfilter
      2 N = 500
      3 x = cupy.linspace(0, 10, N)
      4 y = cupy.linspace(0, 10, N)
      5 xx, yy = cupy.meshgrid(x, y)

~/cuxfilter/python/cuxfilter/__init__.py in <module>
----> 1 from .dataframe import DataFrame
      2 
      3 from ._version import get_versions
      4 
      5 __version__ = get_versions()["version"]

~/cuxfilter/python/cuxfilter/dataframe.py in <module>
      4 from typing import Type
      5 
----> 6 from .dashboard import DashBoard
      7 from .layouts import single_feature
      8 from .themes import light

~/cuxfilter/python/cuxfilter/dashboard.py in <module>
      5 from panel.io.server import get_server
      6 
----> 7 from .charts.core.core_chart import BaseChart
      8 from .datatile import DataTile
      9 from .layouts import single_feature

~/cuxfilter/python/cuxfilter/charts/__init__.py in <module>
      6 
      7 from .bokeh import bokeh
----> 8 from .cudatashader import cudatashader
      9 from .altair import altair
     10 from .panel_widgets import panel_widgets

~/cuxfilter/python/cuxfilter/charts/cudatashader/__init__.py in <module>
----> 1 from .cudatashader import scatter_geo, scatter, line, heatmap, stacked_lines

~/cuxfilter/python/cuxfilter/charts/cudatashader/cudatashader.py in <module>
----> 1 from . import plots
      2 
      3 
      4 def scatter_geo(
      5     x,

~/cuxfilter/python/cuxfilter/charts/cudatashader/plots.py in <module>
      7 from .custom_extensions import InteractiveImage
      8 
----> 9 import cudatashader as cds
     10 from cudatashader import transfer_functions as tf
     11 from cudatashader.colors import Hot

ModuleNotFoundError: No module named 'cudatashader'

from cuxfilter.

AjayThorve avatar AjayThorve commented on May 18, 2024

Oh, I am sorry for the misunderstanding, I was just confirming if the syntax was such, would you be fine with it. It's not implemented yet, hopefully soon.

from cuxfilter.

jakirkham avatar jakirkham commented on May 18, 2024

Ah ok, sorry, I got really excited to try. Apologies for misreading things. 😅

Yeah I think the syntax is reasonable. Thanks for giving that a go.

It's probably worth taking a look at imshow and matshow to get a better feeling on what the different origin locations are used for.

from cuxfilter.

github-actions avatar github-actions commented on May 18, 2024

This issue has been marked rotten due to no recent activity in the past 90d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

from cuxfilter.

github-actions avatar github-actions commented on May 18, 2024

This issue has been marked stale due to no recent activity in the past 30d. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be marked rotten if there is no activity in the next 60d.

from cuxfilter.

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.