这是我的代码。我正在尝试连接/绘制中心和不同节点之间的路径。现在我想stroke为不同的路径制作不同的颜色。我创建了一个颜色数组,其中路径的笔触颜色是什么。但我不能把它stroke做成不同的颜色。
var lineFunction = d3.svg.line()
.x(function(d) { return d.x;})
.y(function(d) { return d.y;})
.interpolate("linear");
var lineGraph = vis.append("g")
.append("path")
.attr("d", lineFunction(CenterList))
.attr("stroke", function(d, i) { return ColorArr[i]; } )
.attr("stroke-width", 5)
.attr("fill", "none")
.attr("id", "viz");
ColorArr=black, black, red, red, black, black, black, red, black, red;
Run Code Online (Sandbox Code Playgroud) 格拉法纳版本7.3.3。我在 之上创建了一个自定义变量JSON Datasource。下面的有效负载我用来填充变量选项$Project
[{"text": "Proj1", "value": "1"}, {"text": "Proj2", "value": "2"}]。
现在,对于模板查询,我想使用text选定的 $Project dropdown 。例如
fields.Project:$Project.__text这样的事情。但我只得到value所选变量的 ,$Project而不是text.
有没有办法得到它。
Failed to compile.
/app/node_modules/@ant-design/icons/lib/components/AntdIcon.d.ts
TypeScript error in /app/node_modules/@ant-design/icons/lib/components/AntdIcon.d.ts(2,13):
'=' expected. TS1005
1 | import * as React from 'react';
> 2 | import type { IconDefinition } from '@ant-design/icons-svg/lib/types';
| ^
3 | import type { IconBaseProps } from './Icon';
4 | import { getTwoToneColor, TwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';
5 | export interface AntdIconProps extends IconBaseProps {
Run Code Online (Sandbox Code Playgroud)
我的包.json
{
"name": "web",
"version": "0.1.0",
"private": true,
"dependencies": {
"@types/react-native-fetch-blob": "^0.10.5",
"@types/react-select": "^3.0.16",
"@types/rn-fetch-blob": "^1.2.1",
"antd": "^4.2.4",
"common-tags": "^1.8.0",
"lodash": "^4.17.19", …Run Code Online (Sandbox Code Playgroud) 这是我的d3.js代码段:
<script>
var width = 300,
height = 300,
margin = 20;
var x_centre = width/2;
var y_centre = height/2;
var nuclear_radius = 15;
var vis = d3.select("#chart_container").append("svg:svg")
.attr("width", width)
.attr("height", height);
var radiuses = [1,2,3];
var multiplier = (d3.min([width, height]) - 2*margin - nuclear_radius) / (d3.max(radiuses) * 2);
var shells = vis.selectAll("circle.shell")
.data(radiuses)
.enter().append("circle")
.attr("class", "shell")
.attr("cx", x_centre)
.attr("cy", y_centre)
.attr("r", function(d, i) {
return (d * multiplier);
});
var nucleus = vis.selectAll('circle.nucleus')
.data(['nucleus'])
.enter().append("circle")
.attr("class", "nucleus")
.attr("cx", x_centre) …Run Code Online (Sandbox Code Playgroud) 我对 JSTL 很陌生。
现在我已经创建了一个 HashMap 并在 jsp 页面中呈现它。
这就是我创建 HashMap 的方式
在应用层:
public HashMap<String, String> uploadSmelter(){
HashMap<String, String> progress = new HashMap<String, String>();
try {
CompanyEntity instanceNew = (CompanyEntity) sessionFactory.getCurrentSession()
.createCriteria(CompanyEntity.class)
.add(Restrictions.eq("name", smObj.getName()))
.add(Restrictions.eq("metal", MetalEnum.valueOf(metal))).uniqueResult();
if (instanceNew != null){
//logger.info();
progress.put("error", Integer.toString(1));
progress.put("errorMsg", "Company : " +smObj.getName() + " for Metal: " + metal + " exists." );
}
}
return progress
}
Run Code Online (Sandbox Code Playgroud)
在控制器级别:
HashMap<String, String> result = new HashMap<String, String>();
result.put("error", "0");
result.put("update", "0");
result.put("create", "0");
HashMap<String, String> progress …Run Code Online (Sandbox Code Playgroud) 我创建了一个名为的地图result.
在sortByKeys方法中,因为我的键是带有数值的String,我将它们转换为Integer键类型Map然后对它们进行排序.
当我循环并单独打印时,排序工作正常,但是当我在另一个Map中设置它们时则不行.
public class TestDate {
public static void main (String args[]){
Map<String, String> result = new HashMap<String, String>();
result.put("error", "10");
result.put("1","hii");
result.put("Update","herii");
result.put("insert","insert");
result.put("10","hiiuu");
result.put("7","hii");
result.put("21","hii");
result.put("15","hii");
Map<String, String> sorted = sortByKeys(result);
//System.out.println(sorted);
}
private static Map<String, String> sortByKeys(Map<String, String> map) {
Map <Integer,String> unSorted = new HashMap<Integer, String>();
Map <String,String> sorted = new HashMap<String, String>();
for (Map.Entry<String, String> entry : map.entrySet())
{
try{
int foo = Integer.parseInt(entry.getKey());
unSorted.put(foo, entry.getValue());
}catch (Exception e){
} …Run Code Online (Sandbox Code Playgroud) 我打开了一张图片QHBoxLayout.我需要裁剪打开的图像并保存裁剪的图像.我怎样才能在PySide中做到这一点?
import sys
from PySide import QtGui, QtCore
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.initUI()
def initUI(self):
hbox = QtGui.QHBoxLayout(self)
pixmap = QtGui.QPixmap("re.png")
lbl = QtGui.QLabel(self)
lbl.setPixmap(pixmap)
self.rect = QtCore.QRect()
hbox.addWidget(lbl)
self.setLayout(hbox)
self.setGeometry(300, 300, 280, 170)
self.setWindowTitle('Open Image')
self.show()
# Tried here to implement Qpen
#self.painter = QtGui.QPainter(self)
#self.painter.setPen(QtGui.QPen(QtCore.Qt.black, 1, QtCore.Qt.SolidLine));
#self.painter.drawRect(self.rect);
def main():
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
Run Code Online (Sandbox Code Playgroud)