适用于 Web 应用程序的 3D 散点图

发布于 2024-08-04 13:21:59 字数 509 浏览 3 评论 0原文

我正在寻找用于 Web 应用程序的散点图 3D 组件。现在我正在使用 JMathPlot (在 Java Applet 内)来生成如下内容:

替代文本 http://jmathtools.berlios.de/lib/exe/ fetch.php?media=scatterplot3d.png

JMathPlot 很好,但缺少一些必需的功能(我对绘图点的工具提示特别感兴趣)。

还有其他选择吗?任何交互式网络技术(javascript、java applet、flash、silverlight)都可以。当将鼠标悬停在某个点上时,用户应该能够旋转/缩放绘图并查看工具提示。

I am looking for a Scatter Plot 3D component for a Web application. Right now I am using JMathPlot (inside a Java Applet) to produce something like this:

alt text http://jmathtools.berlios.de/lib/exe/fetch.php?media=scatterplot3d.png

JMathPlot is fine, but is missing some required functionality (I am especially interested in having tooltips for the plot points).

Are there any alternatives? Any interactive web technology (javascript, java applet, flash, silverlight) is fine. The user should be able to rotate/zoom the plot and see the tooltips, when hovering the mouse over a point.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

秋心╮凉 2024-08-11 13:21:59

两种 silverlight 都有几个简单的 3D 引擎(例如 http://www.markdawson.org/Kit3D/< /a> 或 http://www.codeplex.com/aXelerateSL3D)和 flash (在此列出) 如果您了解 ActionScript、VB.NET 或 C#,那么您自己创建这样的图表应该很容易。

Flash 10 版本甚至有一个内置简单的“3d 引擎”

Flash Player 10 允许 xyz 翻译
和 2D 表面的 xyz 旋转
x、y 和 z 轴。 Flash Player 10 也
显示视角和相机
您设置的角度以创建类似 3D 的效果
效果。

这可能就是您自己快速构建它所需的全部内容。

由于 JMathPlot 是开源的,因此根据您的需求采用它可能是另一种选择。

There are several simple 3D engines for both silverlight (eg. http://www.markdawson.org/Kit3D/ or http://www.codeplex.com/aXelerateSL3D) and flash (list here) given that you know either ActionScript, VB.NET or C# it should be easy to create such a chart yourself.

Version 10 of flash even has a built in simple "3d engine":

Flash Player 10 allows xyz translation
and xyz rotation of 2D surfaces on the
x, y, and z axes. Flash Player 10 also
displays the perspective and camera
angles you set to create 3D-like
effects.

That's probably all you need to quickly built it yourself.

Since JMathPlot is open source, adopting it for your needs could be another option.

巡山小妖精 2024-08-11 13:21:59

您可能还想了解处理。他们可能没有现成的组件,但网络上有数以千计的优秀源代码示例。

You might also want to look into Processing. They may not have ready-made components, but there are thousands of good source-code examples on the web.

风透绣罗衣 2024-08-11 13:21:59

James Black 建议使用 canvas 标签,这是一个非常好的建议。不错,但它需要非 IE 更新的浏览器。或者确实如此?感谢谷歌,您将能够在 IE 中使用 Chrome 渲染器。这样,您就可以将动态图表定位到支持 HTML5 的浏览器(Gecko、Webkit 和 Presto),并要求 IE 用户在 Google 的 Add on 推出后安装它。 canvas 可以跨浏览器工作,这要归功于所有非 IE 的本机支持以及 Google 的探索 Canvas< /a> IE 插件。 SVG 支持也可跨浏览器谢谢 一些插件 适用于 IE。请注意,如果您需要 IE 的 Chrome 渲染器,则不需要其他任何东西。

您可以使用canvassvg 来制作图表,并且已经有一些库可以做所以。这两种技术都允许您创建动态图表,但它们有一些不同的方法。

SVG                                        canvas
-------------------------------------------------------------------------------
Has scene DOM (SVG DOM, though)            Single HTML element, 
                                           rendering script-driven
Deals in shapes                            Deals in pixels
Somewhat hard to mix with HTML (not XHTML) Behaves like an image in both
Event handling easy                        Event handling hard

我认为我会使用 SVG 来做你想做的事情,因为向其中添加动态标签非常简单,但很难为伪创建真正灵活的 API 3D 散点图。

svg 的问题在于,通过尝试创建一种非常灵活的语言,您会得到一种非常复杂的语言。在这里您可以看到两个库中编写的代码执行相同的操作。

SVG

var rect = document.createElementNS(SVG_NS, "rect");
rect.setAttribute("x", "5");
rect.setAttribute("y", "5");
rect.setAttribute("width", "20");
rect.setAttribute("height", "20");
rect.setAttribute("fill", "red");
parent.appendChild(rect);

var poly = document.createElementNS(SVG_NS, "polygon");
poly.setAttribute("fill", "green");
poly.setAttribute("points", "-40,40 0,-40, 40,40");
parent.appendChild(poly);

画布

with (ctx) {
  fillStyle = "red";
  fillRect(5, 5, 20, 20);
}

with (ctx) {
  fillStyle = "green";
  beginPath();
  moveTo(-40, 40);
  moveTo(0, -40);
  moveTo(40, 40);
  closePath();
  fill();
}

James Black's suggestion to use the canvas tag, is a very good one, but it requires a non IE updated browser. Or does it? Thanks to google, you will be able use the Chrome Renderer within IE. This way you'd target HTML5 enabled browsers (Gecko, Webkit and Presto) with your dynamic graphs, and ask IE users to install Google's Add on once it comes out. canvas works cross browser thanks to native support in everything non-IE, and to Google's Explore Canvas plugin for IE. SVG support is also available cross browser thanks to some plugins for IE. Note that if you require the Chrome Renderer for IE, you don't need anything else.

You could either use canvas or svg to do the graphs, and there are already some libraries to do so. Both technologies allow you to create dynamic graphs, but they have some different approaches.

SVG                                        canvas
-------------------------------------------------------------------------------
Has scene DOM (SVG DOM, though)            Single HTML element, 
                                           rendering script-driven
Deals in shapes                            Deals in pixels
Somewhat hard to mix with HTML (not XHTML) Behaves like an image in both
Event handling easy                        Event handling hard

I'd think that I'd go with SVG to do what you want, as it will be dead simple to add dynamic labels to it, but it will be hard to create a truly flexible API for pseudo 3D scatter plots.

The problem with svg is that by attempting to make a very flexible language, you have a very complex one. Here you can see code written in both libraries that do the same thing.

SVG

var rect = document.createElementNS(SVG_NS, "rect");
rect.setAttribute("x", "5");
rect.setAttribute("y", "5");
rect.setAttribute("width", "20");
rect.setAttribute("height", "20");
rect.setAttribute("fill", "red");
parent.appendChild(rect);

var poly = document.createElementNS(SVG_NS, "polygon");
poly.setAttribute("fill", "green");
poly.setAttribute("points", "-40,40 0,-40, 40,40");
parent.appendChild(poly);

Canvas

with (ctx) {
  fillStyle = "red";
  fillRect(5, 5, 20, 20);
}

with (ctx) {
  fillStyle = "green";
  beginPath();
  moveTo(-40, 40);
  moveTo(0, -40);
  moveTo(40, 40);
  closePath();
  fill();
}
无需解释 2024-08-11 13:21:59

Embedded flash object

FlashAndMath 对于此类事情有一些有趣的库:

http://www.flashandmath.com/advanced/contours/combo.html

Embedded flash object

FlashAndMath have some interesting libraries for this sort of thing:

http://www.flashandmath.com/advanced/contours/combo.html

短暂陪伴 2024-08-11 13:21:59

您可以考虑使用 canvas 标签执行此操作,对于任何更新的浏览器(IE 除外),您都可以获得工具提示,因为它与任何其他 html 标签一样具有事件。

您可以使用 excanvas 获得 IE 上的大部分功能,我只是没有运气绘制文本。

它不是一个库,但它可以为您提供使用 javascript 在 html 中工作的能力。

You could look at just doing this with the canvas tag, and for any updated browser, except IE, you could get tooltips, as it has events just like any other html tag.

You can get most of the functionality on IE using excanvas, I just haven't had luck drawing text.

It isn't a library, but it would provide you the capability to work just in html with javascript.

微暖i 2024-08-11 13:21:59

canvasXpress 的 3D 散点图提供了 JavaScript 和 Canvas 替代方案。 http://canvasxpress.org/scatter3d.html

The 3d scatter plot from canvasXpress offers a JavaScript and Canvas alternative. http://canvasxpress.org/scatter3d.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文