0 关注者 · 3 帖子

级联样式表 (CSS) 是一种样式表语言,用于描述以标记语言编写的文档的展示形式。

官方网站

新增
文章 Lilian Huang · 五月 13 2m read

这一次,我们使用 React 作为 IRIS 的前端开发工具,这本身并不是真正的编程。在使用网络开发框架(不限于 React)时,一个关键的考虑因素是使用哪种 CSS 框架。到目前为止,我们一直在使用 Bootstrap,它是标准的,也是最容易上手的。

不过,虽然它很容易使用,但我觉得它提供的自定义灵活性有限。也就是说,即使我们要改用其他 CSS 框架,学习它并从头开始重写所有内容也是一项巨大的工作,所以我们就保持原样。

这一次,在获得了名为 "Claude Code "的强大工具后,我试着让它将 Bootstrap 转换为 Materialize。结果是:修改一次性完成。包括验证在内,整个过程不到五分钟。如果我自己研究 Materialize 并实现它,我想至少需要两三天的时间。

引导式屏幕

BootStrap

Materialize 屏幕

简单地更改样式表并不有趣,所以我还要求修复一个我注意到是错误但一直没有解决的问题。

问题是,即使在编辑屏幕上删除了数据,这些数据仍然会出现在左侧的列表中。

只需一个请求就能轻松解决这个问题。

以下是修复请求的内容:

After pressing the delete button in ExpenseItem.tsx and deleting the corresponding record, update the list in ExpenseItemList.txt so that the deleted item is no longer included in the list.
0
0 14
文章 姚 鑫 · 十月 9, 2022 3m read

第十一章 CSP 架构 - Web Application Settings

Special Case: DeepSee

对于使用 DeepSeeWeb 应用程序,它需要访问 %DeepSee 包中的所有类。要使特定应用程序能够使用 ,请在 命名空间中使用以下命令:

Do EnableDeepSee^%SYS.cspServer("/csp/webapp/")

其中 是带有斜杠的 应用程序名称。前面的命令等价于以下命令:

Set ^SYS("Security","CSP","AllowClass","web-app-name","%DeepSee.") = 1
Set ^SYS("Security","CSP","AllowClass","web-app-name","%CSP.UI.Portal.About")=1

其中 是带有尾随冲突的 Web 应用程序的名称。请注意,第一行使用 。有一个尾随句点。

或者,要使所有应用程序都能使用 ,请使用以下变体:

Do EnableDeepSee^%SYS.cspServer(0)

例如,要启用 /csp/webapp Web 应用程序以使用 ,请使用以下命令:

要禁止特定 应用程序使用 DeepSee,请使用以下命令:

编辑 应用程序设置

可以在管理门户的编辑 应用程序页面上创建或修改 如何处理特定

0
0 180
文章 Michael Lei · 四月 13, 2022 7m read

image

这篇文章是对我的  iris-globals-graphDB 应用的介绍。
在这篇文章中,我将演示如何在Python Flask Web 框架和PYVIS交互式网络可视化库的帮助下,将图形数据保存和抽取到InterSystems Globals中。

建议

 

第一步 : 通过使用Python 原生SDK建立与IRIS Globals的链接

 #create and establish connection
  if not self.iris_connection:
        self.iris_connection = irisnative.createConnection("localhost", 1972, "USER", "superuser", "SYS")
                                     
  # Create an iris object
  self.iris_native = irisnative.createIris(self.iris_connection)
  return self.iris_native

 

第二步 : 使用 iris_native.set( ) 功能把数据保存到Globals 里     

#import nodes data from csv file
isdefined = self.iris_native.isDefined("^g1nodes")
if isdefined == 0:
with open("/opt/irisapp/misc/g1nodes.csv", newline='') as csvfile:

reader = csv.DictReader(csvfile) for row in reader: self.iris_native.set(row["name"], "^g1nodes", row["id"])

#import edges data from csv file isdefined = self.iris_native.isDefined("^g1edges") if isdefined == 0: with open("/opt/irisapp/misc/g1edges.csv", newline='') as csvfile: reader = csv.DictReader(csvfile) counter = 0                 for row in reader: counter = counter + 1 #Save data to globals self.iris_native.set(row["source"]+'-'+row["target"], "^g1edges", counter)  

 

第三步: 使用iris_native.get() 功能把节点和边缘数据从Globals传递给PYVIS

 #Get nodes data for basic graph    
  def get_g1nodes(self):
        iris = self.get_iris_native()
        leverl1_subscript_iter = iris.iterator("^g1nodes")
        result = []
        # Iterate over all nodes forwards
        for level1_subscript, level1_value in leverl1_subscript_iter:
#Get data from globals
            val = iris.get("^g1nodes",level1_subscript)
            element = {"id": level1_subscript, "label": val, "shape":"circle"}
            result.append(element)            
        return result

    #Get edges data for basic graph       def get_g1edges(self):         iris = self.get_iris_native()         leverl1_subscript_iter = iris.iterator("^g1edges")         result = []         # Iterate over all nodes forwards         for level1_subscript, level1_value in leverl1_subscript_iter: #Get data from globals             val = iris.get("^g1edges",level1_subscript)             element = {"from": int(val.rpartition('-')[0]), "to": int(val.rpartition('-')[2])}             result.append(element)                     return result

 

Step4: Use PYVIS Javascript to generate graph data

<script type="text/javascript">
    // initialize global variables.
    var edges;
    var nodes;
    var network;
    var container;
    var options, data;
 
    // This method is responsible for drawing the graph, returns the drawn network
    function drawGraph() {
        var container = document.getElementById('mynetwork');
        let node = JSON.parse('{{ nodes | tojson }}');
        let edge = JSON.parse('{{ edges | tojson }}');
     
       // parsing and collecting nodes and edges from the python
        nodes = new vis.DataSet(node);
        edges = new vis.DataSet(edge);

        // adding nodes and edges to the graph         data = {nodes: nodes, edges: edges};

        var options = {           "configure": {                 "enabled": true,                 "filter": [                 "physics","nodes"             ]             },             "nodes": {                 "color": {                   "border": "rgba(233,180,56,1)",                   "background": "rgba(252,175,41,1)",                   "highlight": {                     "border": "rgba(38,137,233,1)",                     "background": "rgba(40,138,255,1)"                   },                   "hover": {                   "border": "rgba(42,127,233,1)",                     "background": "rgba(42,126,255,1)"                 }                 },

                "font": {                   "color": "rgba(255,255,255,1)"                 }               },             "edges": {                 "color": {                     "inherit": true                 },                 "smooth": {                     "enabled": false,                     "type": "continuous"                 }             },             "interaction": {               "dragNodes": true,                 "hideEdgesOnDrag": false,               "hideNodesOnDrag": false,                 "navigationButtons": true,                 "hover": true             },

            "physics": {                 "barnesHut": {                     "avoidOverlap": 0,                   "centralGravity": 0.3,                   "damping": 0.09,                     "gravitationalConstant": -80000,                     "springConstant": 0.001,                     "springLength": 250                 },

                "enabled": true,                 "stabilization": {                     "enabled": true,                     "fit": true,                     "iterations": 1000,                     "onlyDynamicEdges": false,                     "updateInterval": 50                 }             }         }         // if this network requires displaying the configure window,         // put it in its div         options.configure["container"] = document.getElementById("config");         network = new vis.Network(container, data, options);       return network;     }     drawGraph(); </script>

 

第五步: 从app.py 主文件调用上面的代码

#Mian route. (index)
@app.route("/")
def index():
    #Establish connection and import data to globals
    irisglobal = IRISGLOBAL()
    irisglobal.import_g1_nodes_edges()
    irisglobal.import_g2_nodes_edges()

    #getting nodes data from globals     nodes = irisglobal.get_g1nodes()     #getting edges data from globals     edges = irisglobal.get_g1edges()

    #To display graph with configuration     pyvis = True     return render_template('index.html', nodes = nodes,edges=edges,pyvis=pyvis)    

下面是关于此项目的 介绍视频:

0
0 484