小编lin*_*ran的帖子

如何使用d3js获取svg元素的宽度?

我正在使用d3js来查找svg元素的宽度,代码如下所示:

<script>
    var body = d3.select("body");
    console.log(body);
    var svg = body.select("svg");
    console.log(svg);
    console.log(svg.style("width"));
</script>

<svg class="svg" height="3300" width="2550">
   <image x="0" y="0" height="3300" width="2550" xlink:href="1.jpg"></image>
   <rect class="word" id="15" x="118" y="259" width="182" height="28"
      text="Substitute"></rect>
</svg>
Run Code Online (Sandbox Code Playgroud)

但是它返回了这个错误:

未捕获的TypeError:无法调用null的方法'getPropertyValue'

我认为,svg变量是一个空数组.

如何使用d3js获取svg元素的宽度?

javascript svg d3.js

32
推荐指数
4
解决办法
4万
查看次数

jquery .ready()等效于d3js?

目前我<head>在uglying as file后使用HTML添加所有javascript并使用这些jquery函数来检查文档准备好了

$( document ).ready(function() {}); OR $(function() {});
Run Code Online (Sandbox Code Playgroud)

有没有相当于删除使用这些jquery函数的d3js?

javascript jquery d3.js

12
推荐指数
2
解决办法
3016
查看次数

如何根据环境禁用 NestJS Logger?

我在NestFactory.create()方法中使用记录器选项来控制生产模式下记录器的日志级别,但它不起作用ENV='production',仍然显示Logger.log()消息

const bootstrap = async () => {
  const app = await NestFactory.create<NestExpressApplication>(AppModule, {
    logger:
      env.ENV == 'development'
        ? ['debug', 'error', 'log', 'verbose', 'warn']
        : ['error', 'warn'],
  });

  app.enableCors();

  app.use(helmet());
  app.set('trust proxy', 1);
Run Code Online (Sandbox Code Playgroud)

typescript nestjs

8
推荐指数
1
解决办法
9665
查看次数

meteor的restrictCreationByEmailDomain选项如何工作?

我只是阅读meteor的帐户配置选项,"restrictCreationByEmailDomain"选项很棒

Accounts.config({ restrictCreationByEmailDomain: 'school.edu' })
Run Code Online (Sandbox Code Playgroud)

我想知道我可以使用逗号或数组分隔的域列表代替'school.edu'是否有任何简单的流星帐户系统教程?请帮助

javascript node.js meteor meteorite

6
推荐指数
1
解决办法
460
查看次数

流星重启在终端控制台中显示错误"无法接收keepalive!退出"

目前我正在编写Meteor 0.9.3,Ubuntu 14.04和VMware 10

每次我编辑我的代码时,meteorjs都需要花费太多时间重启,而ubuntu终端控制台显示错误.有时它也会在chrome中显示"意外错误".

=> Meteor server restarted
=> Client modified -- refreshing
I20140927-13:24:11.922(5.5)? Failed to receive keepalive! Exiting.
=> Exited with code: 1
=> Meteor server restarted
=> Client modified -- refreshing
I20140927-13:25:27.484(5.5)? Failed to receive keepalive! Exiting.
=> Exited with code: 1
=> Client modified -- refreshing
=> Exited from signal: SIGUSR2
=> Meteor server restarted
=> Client modified -- refreshing
I20140927-13:33:04.041(5.5)? Failed to receive keepalive! Exiting.
=> Exited with code: 1
=> Meteor server restarted
=> …
Run Code Online (Sandbox Code Playgroud)

meteor

5
推荐指数
1
解决办法
479
查看次数

如何使用Centos7在生产服务器中部署meteor应用程序

如何在centos7中部署流星.我们安装了meteor和meteorjs包和nodejs.但是我们无法打开生产链接.请帮帮我.

meteor meteor-up

3
推荐指数
1
解决办法
2380
查看次数

如何在phpexcel中实现比Z更多的细胞?

$PHPExcel->getDefaultStyle()->getFont()->setName('Arial')
->setSize(10);

$PHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', 'Linto')
->setCellValue('B1', 'Cheeran')
->setCellValue('A2', 'Sandhya');

$PHPExcel->getActiveSheet()->setCellValue('A5', 'date')
->setCellValue('B5', '31-12-2010');
Run Code Online (Sandbox Code Playgroud)

如果有更多的细胞,如何在phpexcel中控制它们?

->setCellValue('A1', 'Linto')
->setCellValue('Z1', 'Linto')
Run Code Online (Sandbox Code Playgroud)

在Z1之后,下一行和列中的单元格表示是什么?

php phpexcel

1
推荐指数
1
解决办法
1827
查看次数

铁路由器notFound模板不在流星中工作

// main.html

<template name="layout">
    {{yield}}
</template>

<template name="notFound">
    notFound
</template>

// router.js

Router.configure({
    layoutTemplate: "layout",
    loadingTemplate: "loading",
    notFoundtemplate: "notFound"
});

Router.map(function() {

    this.route('home', {
        path: '/'
    });

});
Run Code Online (Sandbox Code Playgroud)

" http://hedcet.com:3000/ "完美运作

当我尝试在router.js中未定义的" http://hedcet.com:3000/x"(route/x)时,它在控制台中显示错误而不显示notFound模板

// console error

Uncaught Error: Oh no! No route found for path: "/x"
Run Code Online (Sandbox Code Playgroud)

你能提出任何解决方案吗?我想显示notFound模板,如果有任何尝试在流星中的非现有路径

javascript meteor meteorite iron-router

1
推荐指数
1
解决办法
1708
查看次数

在html元素的id中插入点或句点的目的是什么

我不知道在html元素的id中插入点或句点的目的是什么,我们在任何编码语言中都有任何额外的好处吗?

<div id="PAT.TID" class="lineHeight frmData">Headset,  e.g. Bluetooth headset,  for mobile device has configuration logic which configures headset based on sensor data indicating whether headset is being worn by user</div>
Run Code Online (Sandbox Code Playgroud)

我想选择id ="PAT.TID"的div,我该怎么做

document.querySelector('#PAT\.TID')
Run Code Online (Sandbox Code Playgroud)

这里我null在chrome浏览器控制台中有一个对象

我如何选择像使用纯javascript的id元素中包含的wildchar?(如querySelector)

html javascript css jquery

1
推荐指数
1
解决办法
67
查看次数

javascript split()使用regEx

我想使用javascript split()函数拆分"A // B/C"字符串

"A//B/C".split(/\//g)
Run Code Online (Sandbox Code Playgroud)

但它的输出是["A", "", "B", "C"]但我的预期输出是

["A/", "B", "C"]
Run Code Online (Sandbox Code Playgroud)

我是如何使用javascript做到这一点的?

javascript regex

0
推荐指数
1
解决办法
268
查看次数