所以我有下一个用于设置节点,链接和其他元素的强制布局图代码:
var setLinks = function ()
{
link = visualRoot.selectAll("line.link")
.data(graphData.links)
.enter().append("svg:line")
.attr("class", "link")
.style("stroke-width", function (d) { return nodeStrokeColorDefault; })
.style("stroke", function (d) { return fill(d); })
.attr("x1", function (d) { return d.source.x; })
.attr("y1", function (d) { return d.source.y; })
.attr("x2", function (d) { return d.target.x; })
.attr("y2", function (d) { return d.target.y; });
graphData.links.forEach(function (d)
{
linkedByIndex[d.source.index + "," + d.target.index] = 1;
});
};
var setNodes = function ()
{
node = visualRoot.selectAll(".node")
.data(graphData.nodes)
.enter().append("g")
.attr("id", …Run Code Online (Sandbox Code Playgroud) 我有基于力布局的图表.我想放置一个'加载'叠加层,直到图表完成放置节点.我可以使用什么事件/属性来找出该图表?
我检查了API,找不到任何东西..
这是一个问题:
我和D3合作.尝试将图像添加到节点.渲染文件是svg文件:
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.2/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="400px" height="400px" viewBox="0 0 400 400" enable- background="new 0 0 400 400" xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<path fill="#5DD7FC" d="M0.5,262.094c0,0,52.172,79.049,158.323,77.241c68.433- 2.031,165.549-32.296,191.523-132.123 c0,0,27.893,4.742,47.654-16.939c-26.99,3.727-44.944- 4.743-44.944-4.743s35.346-1.017,43.137-21.908 c-20.89,9.035-46.751,1.355-46.751,1.355S337.245,90.22,262.939"/>
</svg>
Run Code Online (Sandbox Code Playgroud)
所以,我正在尝试使用此代码将其连接到图像源(直接用于现在):
d3GraphWidget._node.append("image")
.attr("xlink:href", "http://localhost:13980/Areas/Widgets/Content/graphwidgetrelated/img/twittericon.svg")
.attr("x", -8)
.attr("y", -8)
.attr("width", 16)
.attr("height", 16);
Run Code Online (Sandbox Code Playgroud)
但我没有看到任何渲染,只是一个'空图像图标'.直接进入链接时,浏览器发现该文件没有问题.
那么,如何在D3中使用svg文件作为图像源?
谢谢你的任何建议,
亚历克斯
我需要清楚地看到什么IP地址对SQL服务器进行了什么SQL查询.我正在尝试使用SQL事件探查器,但似乎我无法以某种方式区分查询来自的机器(浏览器).它只有Web服务器和SQL Server之间的通信详细信息.对我来说有什么办法(任何未知的日志吗?),这样我就可以看到查询来自的原始机器的标识?
谢谢你的任何建议.
HF
我试图改变一些svg元素的样式.当我这样做:
var circleSelected = d3.select("#circleid_2");
circleSelected.style("fill", "purple");
circleSelected.style("stroke-width", 5);
circleSelected.style("stroke", "red");
Run Code Online (Sandbox Code Playgroud)
圆圈正在改变它的风格.
但是,当我这样做时:
var allCircles = d3.selectAll(".circle");
allCircles.forEach(function (circle) {
circle.style("fill", "green"); //function(d) { return getNodeColor(d); }
});
Run Code Online (Sandbox Code Playgroud)
它不适用于错误:对象[对象SVGCircleElement]没有方法'style'
这是我的'圈'声明(注意:它有class和id):
node.append("circle")
.attr("id", function (d) { return "circleid_" + d.id; })
.attr("class", "circle")
.attr("cx", function (d) { return 0; })
.attr("cy", function (d) { return 0; })
.attr("r", function (d) { return getNodeSize(d); })
.style("fill", function (d) { return getNodeColor(d); })
.style("stroke", function (d) { return getNodeStrokeColor(d); })
.style("stroke-width", function (d) …Run Code Online (Sandbox Code Playgroud) 我刚刚使用 Ninject 3 更新了我的应用程序。将 App_Start 中的文件从 NinjectMVC3 更改为 NinijectWebCommon.cs。移动了我的文件,更新了 DLL。现在我开始收到此错误:
“使用 Dictionary{string, string} Provider 的条件隐式自绑定激活 Dictionary{string, string} 时出错,返回 null。激活路径:4) 将依赖项 Dictionary{string, string} 注入到 MapWidgetViewModel 类型的构造函数的参数 widgetSettings 3)将依赖项 IDetailedSearchResultCollectionWidget 注入 MediaSourcesViewModel 类型的构造函数的参数 mediaWidgets 2) 将依赖项 ITabItem 注入 TabNavigationController 类型的构造函数的参数 tabItems 1) 请求 TabNavigationController
建议:1)确保提供商正确处理创建请求。”
在这里生成它的代码:
public MediaSourcesViewModel(IEnumerable<IMediaSourcesDataProvider> dataProviders,
IEnumerable<IDetailedSearchResultCollectionWidget> mediaWidgets,
IMediaItemDetailsWidget itemDetailsWidget)
{
this.Description = "Source list";
this.ActionName = "DisplaySourcesAsPartial";
this.ControllerName = "MediaSources";
this.DefaultType = "MediaManagement";
_dataProviders = dataProviders;
MediaWidgets = new List<IDetailedSearchResultCollectionWidget>();
MediaWidgets.AddRange(mediaWidgets); //Set Tab Info
this.Name = "Sources";
} …Run Code Online (Sandbox Code Playgroud) 我正在使用BundleConfig将我的css和javascript文件捆绑在mvc 4.0项目中.刚开始使用它,但不知怎的,我的捆绑的css文件从服务器获得404状态.想知道是什么问题.
这是我的设置;
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/CSSJSBundles/3rdpartycss").Include(
"~/Scripts/jquery.jnotify.css"
Run Code Online (Sandbox Code Playgroud)
)); }
BundleTable.EnableOptimizations = true;
}
Run Code Online (Sandbox Code Playgroud)
我在我的根目录中创建了该文件夹:'CSSJSBundles'.我需要吗?或者只是虚拟文件夹mvc使用?我还需要在Global.aspx中设置任何设置吗?
我也删除了该文件夹,该捆绑的css文件仍有404错误.
javascript c# asp.net asp.net-mvc-4 bundling-and-minification